cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
gelbersupport
Engaged Sweeper
Hi,

I am looking for a report that lists all the computers in the environment which are missing domain admins as a member of the local administrators group.

Thanks
1 ACCEPTED SOLUTION
Daniel_B
Lansweeper Alumni
I moved your forum topic to the report requests section.

You can reach your goal by using a subquery which lists computers having "domain admins" in their local administrator group and excluding these assets from your main report. Please find an example below.

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysOS.Image As icon,
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Left Join tsysOS On tblAssets.OScode = tsysOS.OScode
Where tblAssetCustom.State = 1 And tblAssetCustom.AssetID Not In (Select
tblUsersInGroup.AssetID From tblUsersInGroup
Where tblUsersInGroup.Username Like 'domain admins' And
tblUsersInGroup.Admingroup = 1) And tblAssets.Assettype = -1
Order By tblAssets.AssetName

View solution in original post

2 REPLIES 2
gelbersupport
Engaged Sweeper
Perfect, thanks Daniel!
Daniel_B
Lansweeper Alumni
I moved your forum topic to the report requests section.

You can reach your goal by using a subquery which lists computers having "domain admins" in their local administrator group and excluding these assets from your main report. Please find an example below.

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysOS.Image As icon,
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Left Join tsysOS On tblAssets.OScode = tsysOS.OScode
Where tblAssetCustom.State = 1 And tblAssetCustom.AssetID Not In (Select
tblUsersInGroup.AssetID From tblUsersInGroup
Where tblUsersInGroup.Username Like 'domain admins' And
tblUsersInGroup.Admingroup = 1) And tblAssets.Assettype = -1
Order By tblAssets.AssetName