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