‎04-13-2020 03:17 PM
Select Top 1000000 Case
When tblADusers.Displayname Is Null Or
tblADusers.Displayname = '' Then tblADusers.Userdomain + '\' +
tblADusers.Username
Else tblADusers.Displayname
End As Displayname,
tblADusers.Username,
tblADusers.Userdomain,
tblADusers.Department,
'usersm.gif' As icon,
tblADusers.IsEnabled As EnabledInAD,
tblADusers.Lastchanged,
tblADusers.OU
From tblADusers
Where (tblADusers.Department Like '' Or tblADusers.Department Is Null) And
(tblADComputers.OU =
'OU=Location,OU=Users,DC=company,DC=com') Or
(tblADComputers.OU =
'OU=Location,OU=Users,DC=company,DC=com'))
Order By Displayname
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now