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!