Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Chris_Wallace
Engaged Sweeper
Hi,
I am trying to write a report which shows servers which are not members of one of our windows update security groups used to control client side targeting.
I have searched the community site and found similar reports for reporting on AD group membership and have written the following. Can anyone tell me what I am doing wrong? I have tried Not In and Not Exists. The query builder does not allow Not In and Not Exists returns no entries. The subquery I have tested separately and does bring back all servers in a group.

Select Distinct Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblADGroups.Name As ADGroupName,
tblADGroups.Description As ADGroupDescription,
tsysOS.OSname
From tblAssets
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Left Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Left Join tblADMembership On tblADMembership.ChildAdObjectID =
tblADComputers.ADObjectID
Left Join tblADGroups On tblADMembership.ParentAdObjectID =
tblADGroups.ADObjectID
Where tsysOS.OSname Like 'Win 2%' And Not Exists(Select Distinct Top 1000000
tblAssets.AssetName
From tblAssets Left Join tblADComputers On tblAssets.AssetID =
tblADComputers.AssetID Left Join tblADMembership On
tblADMembership.ChildAdObjectID = tblADComputers.ADObjectID Left Join
tblADGroups On tblADMembership.ParentAdObjectID = tblADGroups.ADObjectID
Where tblADGroups.Name Like '%sg-wu%')
Order By tblAssets.AssetName,
ADGroupName

Many Thanks in advance
Chris
0 REPLIES 0

Archive

This board contains archived posts from the retired Lansweeper Forum and Insiders Community.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now