→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
laurentiun
Engaged Sweeper III
Hello,

I would like to find users that are not part of some Active Directory group and exclude some users from report.
exemple: users that are not in AD "group1" and exclude administrators.

Thank you.
1 ACCEPTED SOLUTION
Daniel_B
Lansweeper Alumni
You might use a report like the following example:

Select Top 1000000 tblADusers.Username,
tblADusers.Firstname,
tblADusers.Lastname,
tblADusers.Displayname
From tblADusers
Where tblADusers.Username Not Like 'admin%' And tblADusers.ADObjectID Not In
(Select tblADMembership.ChildAdObjectID
From tblADMembership Inner Join tblADGroups On tblADGroups.ADObjectID =
tblADMembership.ParentAdObjectID
Where tblADGroups.Name Like 'group1%')
Order By tblADusers.Username

View solution in original post

1 REPLY 1
Daniel_B
Lansweeper Alumni
You might use a report like the following example:

Select Top 1000000 tblADusers.Username,
tblADusers.Firstname,
tblADusers.Lastname,
tblADusers.Displayname
From tblADusers
Where tblADusers.Username Not Like 'admin%' And tblADusers.ADObjectID Not In
(Select tblADMembership.ChildAdObjectID
From tblADMembership Inner Join tblADGroups On tblADGroups.ADObjectID =
tblADMembership.ParentAdObjectID
Where tblADGroups.Name Like 'group1%')
Order By tblADusers.Username