
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2016 11:51 PM
Good Afternoon All,
I'm looking for a report to query all PCs on a specific domain and make sure a custom username has full local admin rights on each PC. Any help would be greatly appreciated. I have this thus far:
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblUsersInGroup.Username,
tblUsersInGroup.Domainname,
tblUsersInGroup.Groupname
From tblAssets
Inner Join tblUsersInGroup On tblAssets.AssetID = tblUsersInGroup.AssetID
Where tblAssets.AssetID Not In (Select tblUsers.AssetID From tblUsers
Where tblUsers.Name = 'saveme') And tblUsersInGroup.Groupname =
'administrators'
Order By tblAssets.AssetName
However, I have a strong feeling it's not exactly what I need. saveme is the name of the custom local admin account I'm looking for I need to make sure it exists on all PCs.
I'm looking for a report to query all PCs on a specific domain and make sure a custom username has full local admin rights on each PC. Any help would be greatly appreciated. I have this thus far:
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblUsersInGroup.Username,
tblUsersInGroup.Domainname,
tblUsersInGroup.Groupname
From tblAssets
Inner Join tblUsersInGroup On tblAssets.AssetID = tblUsersInGroup.AssetID
Where tblAssets.AssetID Not In (Select tblUsers.AssetID From tblUsers
Where tblUsers.Name = 'saveme') And tblUsersInGroup.Groupname =
'administrators'
Order By tblAssets.AssetName
However, I have a strong feeling it's not exactly what I need. saveme is the name of the custom local admin account I'm looking for I need to make sure it exists on all PCs.
Solved! Go to Solution.
Labels:
- Labels:
-
Report Center
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2016 12:02 PM
The tblUsersInGroup filter isn't part of your sub query, but your main query. Your report is therefore listing machines without the specified user, but it doesn't verify whether the user is part of the administrators group. It has lines for all admins on the machine as well. The report below should be more accurate. You'll need to insert your own NetBIOS domain name into the highlighted part of the query.
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tsysAssetTypes.AssetTypeIcon10 As icon
From tblAssets
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Where tblAssets.AssetID Not In (Select Top 1000000 tblUsersInGroup.AssetID
From tblUsersInGroup Inner Join tblAssets On tblAssets.AssetID =
tblUsersInGroup.AssetID
Where tblUsersInGroup.Domainname = tblAssets.AssetName And
tblUsersInGroup.Username = 'saveme' And tblUsersInGroup.Groupname =
'administrators') And tblAssets.Domain = 'lansweeper '
Order By tblAssets.AssetName
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2016 05:59 PM
Thank you much Susan!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2016 12:02 PM
The tblUsersInGroup filter isn't part of your sub query, but your main query. Your report is therefore listing machines without the specified user, but it doesn't verify whether the user is part of the administrators group. It has lines for all admins on the machine as well. The report below should be more accurate. You'll need to insert your own NetBIOS domain name into the highlighted part of the query.
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tsysAssetTypes.AssetTypeIcon10 As icon
From tblAssets
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Where tblAssets.AssetID Not In (Select Top 1000000 tblUsersInGroup.AssetID
From tblUsersInGroup Inner Join tblAssets On tblAssets.AssetID =
tblUsersInGroup.AssetID
Where tblUsersInGroup.Domainname = tblAssets.AssetName And
tblUsersInGroup.Username = 'saveme' And tblUsersInGroup.Groupname =
'administrators') And tblAssets.Domain = 'lansweeper '
Order By tblAssets.AssetName
