→ Having trouble accessing our new support portal or creating a ticket? Please notify our team here

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

I'm trying to created a report to show all computers without a particular username in the Local Administrators group. I've spent ages trying to this and getting nowhere.

[edit] I can pull up a report of all the computers with the username in the group but even that triplicates each result.

Does anybody already have some SQL code I could just put into the report.

Thanks in advance
1 ACCEPTED SOLUTION
Hemoco
Lansweeper Alumni
try this

Select tblcomputers.Computername, tblcomputers.ComputerUnique,
tblcomputers.Domain
From tblcomputers
Where tblcomputers.Computername Not In (Select tblUsersInGroup.Computername
From tblUsersInGroup
Where tblUsersInGroup.Groupname = 'administrators' And
tblUsersInGroup.Username = 'someuser')

View solution in original post

3 REPLIES 3
Mercedes_O
Community Manager
Community Manager

Hello @Graymontinfra due to the age of this post I recommend starting a new topic here https://community.lansweeper.com/t5/reports-analytics/bd-p/LansweeperReports

Hemoco
Lansweeper Alumni
try this

Select tblcomputers.Computername, tblcomputers.ComputerUnique,
tblcomputers.Domain
From tblcomputers
Where tblcomputers.Computername Not In (Select tblUsersInGroup.Computername
From tblUsersInGroup
Where tblUsersInGroup.Groupname = 'administrators' And
tblUsersInGroup.Username = 'someuser')

Is it possible to have that code but for the new Lansweeper version?  Thanks