‎08-19-2021 06:05 PM
‎08-24-2021 10:33 PM
‎08-24-2021 10:12 AM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
Count(Query3.Name) As [Number Of Groups]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join (Select tblADGroups.Name,
tblADComputers.AssetID
From tblADGroups
Right Join tblADMembership On tblADGroups.ADObjectID =
tblADMembership.ParentAdObjectID
Right Join tblADComputers On tblADComputers.ADObjectID =
tblADMembership.ChildAdObjectID
Where (tblADGroups.Name = 'Group1' Or tblADGroups.Name =
'Group2')
Group By tblADGroups.Name,
tblADComputers.AssetID) Query3 On Query3.AssetID = tblAssets.AssetID
Where tsysAssetTypes.AssetTypename Like '%win%' And tblAssetCustom.State = 1
Group By tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried
Having (Count(Query3.Name) < 1) Or
(Count(Query3.Name) > 1)
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now