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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sam1
Engaged Sweeper II

Hello,

i am trying to create a report which lists all users who are in both groups.

Im not an sql expert, maybe someone of you has an idea how i could create the report? 🙂

Here is what i have tried:

 

 

Select Top 1000000 tblADusers.Userdomain,
  tblADusers.Username,
  tblADusers.Name,
  tblADusers.OU,
  tblADusers.Lastchanged,
  tblADusers.whenCreated,
  tblADusers.IsEnabled,
  tblADusers.LockoutDate,
  tblADusers.PasswordLastSet,
  tblADusers.PasswordRequired
From tblADusers
Where (tblADusers.IsEnabled = 'True' And tblADusers.ADObjectID In (Select
        tblADMembership.ChildAdObjectID
      From tblADMembership Inner Join tblADGroups On tblADGroups.ADObjectID =
            tblADMembership.ParentAdObjectID
      Where tblADGroups.Name = 'G_1')) Or
  (tblADusers.ADObjectID In (Select tblADMembership.ChildAdObjectID
      From tblADMembership Inner Join tblADGroups On tblADGroups.ADObjectID =
            tblADMembership.ParentAdObjectID
      Where tblADGroups.Name = 'G_2'))

 

 

 

 

 

1 ACCEPTED SOLUTION
Mister_Nobody
Honored Sweeper II

Try replace or to and

View solution in original post

2 REPLIES 2
Mister_Nobody
Honored Sweeper II

Try replace or to and

sam1
Engaged Sweeper II

Thank you! I guess i didn't pay attention.