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

I am able to show the ManagerADObjectID in my report but would like to show the username or displayname instead of the numerical ID. Can someone please assist with this?

Here is the current report script:

***************

Select Top 1000000 '<img src="thumbnail.aspx?user=' + tblADusers.Username +
'&domain=' + tblADusers.Userdomain + '&size=26" class="rimage"/>' As Picture,
tblADusers.Username,
tblADusers.Displayname,
tblADusers.Title,
tblADusers.Description,
tblADusers.Telephone,
tblADusers.email,
tblADusers.Department,
tblADusers.Office,
tblADusers.ManagerADObjectId,
T1.LastLogonTime,
T2.AssetID,
T2.AssetName,
tblADusers.OU
From tblADusers
Left Outer Join (Select tblCPlogoninfo.Username,
tblCPlogoninfo.Domain,
Max(tblCPlogoninfo.logontime) As LastLogonTime
From tblCPlogoninfo
Group By tblCPlogoninfo.Username,
tblCPlogoninfo.Domain) T1 On T1.Domain = tblADusers.Userdomain And
T1.Username = tblADusers.Username
Left Outer Join (Select tblAssets.AssetID,
tblAssets.AssetName,
tblCPlogoninfo.Domain,
tblCPlogoninfo.Username,
tblCPlogoninfo.logontime
From tblAssets
Inner Join tblCPlogoninfo On tblCPlogoninfo.AssetID = tblAssets.AssetID) T2
On T2.Domain = tblADusers.Userdomain And T2.Username = tblADusers.Username
And T2.logontime = T1.LastLogonTime
Where tblADusers.Department Is Not Null And tblADusers.Company Like 'ASR'
Order By tblADusers.Username

***************

Thanks in advance!
2 REPLIES 2
Bruce_B
Lansweeper Alumni
The built-in report "Users: AD users and their managers" should return the information you're looking for. If this report isn't a part of your installation you can also find it here.
dwinters
Engaged Sweeper II
I am interested in this as well.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now