Thank you for the table details! The historical data is helpful and a nice addition beyond the active when scanned data. By far the majority of our users live on a single PC, but the historical data is an extra layer to verify & help troubleshoot the symptoms.
In our case we're only monitoring a single domain (active domain scanning, and user group scanning is being used), so I've elected to not make that column visible. I've also added some extra detail for "at a glance" info like the Description field.
Question- is there a column available that will make a user name clickable to that user page, like AssetID is for asset pages? We're currently forcing a URL, but would love it to be in the name like with assets if that's possible!
Current code:
Select Distinct Top 1000000 tblADusers.Username,
'User Page for: ' + tblADusers.Username As hyperlink_name_hyp,
'http://<main web console URL>/user.aspx?username=' +
Cast(tblADusers.Username As nvarchar) + '&userdomain=XXXXXXX' As hyperlink_hyp,
tblADusers.Description,
tblADusers.whenCreated,
tblADusers.Lastchanged,
tblADusers.OU
From tblADusers
Left Join tblCPlogoninfo On tblCPlogoninfo.Username = tblADusers.Username And
tblCPlogoninfo.Domain = tblADusers.Userdomain
Where (tblCPlogoninfo.AssetID Is Null) Or
(tblCPlogoninfo.AssetID = '')
Order By tblADusers.Username