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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
laurentiun
Engaged Sweeper III
Hello, I would like to have a report with username and SID's for AD users.

Thank you.
1 ACCEPTED SOLUTION
Daniel_B
Lansweeper Alumni
This question was replied to in this forum topic. For the moment only local users' SIDs will be scanned. The following report lists these, but it might not be precise if unrelated local user accounts have the same username as domain user accounts.

Select Distinct Top 1000000 tblADusers.Userdomain,
tblADusers.Username,
tblAssets.AssetName,
tblUsers.SID,
tblAssets.AssetID
From tblAssets
Right Join tblCPlogoninfo On tblAssets.AssetID = tblCPlogoninfo.AssetID
Right Join tblADusers On tblADusers.Username = tblCPlogoninfo.Username And
tblADusers.Userdomain = tblCPlogoninfo.Domain
Left Join tblUsers On tblAssets.AssetID = tblUsers.AssetID And
tblUsers.Name = tblCPlogoninfo.Username
Order By tblADusers.Userdomain,
tblADusers.Username

View solution in original post

1 REPLY 1
Daniel_B
Lansweeper Alumni
This question was replied to in this forum topic. For the moment only local users' SIDs will be scanned. The following report lists these, but it might not be precise if unrelated local user accounts have the same username as domain user accounts.

Select Distinct Top 1000000 tblADusers.Userdomain,
tblADusers.Username,
tblAssets.AssetName,
tblUsers.SID,
tblAssets.AssetID
From tblAssets
Right Join tblCPlogoninfo On tblAssets.AssetID = tblCPlogoninfo.AssetID
Right Join tblADusers On tblADusers.Username = tblCPlogoninfo.Username And
tblADusers.Userdomain = tblCPlogoninfo.Domain
Left Join tblUsers On tblAssets.AssetID = tblUsers.AssetID And
tblUsers.Name = tblCPlogoninfo.Username
Order By tblADusers.Userdomain,
tblADusers.Username