→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Jockeman
Engaged Sweeper II
I would like to customize the default AD report: "Active directory: User has no office filled in", shown below. I would like to only get the users from a specific OU and all sub OUs, in the report. Example: OU=Users,OU=CompanyA,DC=domain,DC=com, and below. But I don't know how to add and use the tblADusers.OU, please advice.

Select Top 1000000 tblADusers.Username,
tblADusers.Userdomain,
tblADusers.Displayname,
tblADusers.Office,
'usersm.png' As icon,
tblADusers.Lastchanged
From tblADusers
Where (tblADusers.Office Like '') Or
(tblADusers.Office Is Null)
Order By tblADusers.Username


Regards
Joakim
1 ACCEPTED SOLUTION
Jockeman
Engaged Sweeper II
This did the trick!

Select Top 1000000 tblADusers.Username,
tblADusers.Userdomain,
tblADusers.Displayname,
tblADusers.Title,
tblADusers.Company,
tblADusers.Department,
tblADusers.Office,
tblADusers.Telephone,
tblADusers.Mobile,
tblADusers.email,
'usersm.png' As icon,
tblADusers.Lastchanged
From tblADusers
Where
tblADusers.OU LIKE '%OU=Users,DC=domain,DC=com'

Order By tblADusers.Username

View solution in original post

1 REPLY 1
Jockeman
Engaged Sweeper II
This did the trick!

Select Top 1000000 tblADusers.Username,
tblADusers.Userdomain,
tblADusers.Displayname,
tblADusers.Title,
tblADusers.Company,
tblADusers.Department,
tblADusers.Office,
tblADusers.Telephone,
tblADusers.Mobile,
tblADusers.email,
'usersm.png' As icon,
tblADusers.Lastchanged
From tblADusers
Where
tblADusers.OU LIKE '%OU=Users,DC=domain,DC=com'

Order By tblADusers.Username