→ The Lansweeper Customer Excellence Awards 2024 - Submit Your Project Now! Learn More & Enter Here
‎07-28-2016 10:48 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Lastseen,
tUserLogons.Username As [Logged on user account],
tblCPlogoninfo.logontime,
tblCPlogoninfo.Username
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Left Join (Select Distinct tblCPlogoninfo.AssetID,
tblCPlogoninfo.Username
From tblCPlogoninfo) tUserLogons On tUserLogons.AssetID = tblAssets.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblCPlogoninfo On tblAssets.AssetID = tblCPlogoninfo.AssetID
Where tblAssetCustom.State = 1
Order By tblAssets.AssetName,
[Logged on user account]
‎02-17-2020 06:36 PM
‎08-04-2016 10:24 PM
Select tblAssets.AssetID,
tblAssets.AssetName,
T1.Domain,
T1.Username,
T1.LastLogonTime
From tblAssets
Inner Join tblAssetCustom On tblAssetCustom.AssetID = tblAssets.AssetID
Inner Join (Select tblCPlogoninfo.AssetID,
tblCPlogoninfo.Username,
tblCPlogoninfo.Domain,
Max(tblCPlogoninfo.logontime) As LastLogonTime
From tblCPlogoninfo
Group By tblCPlogoninfo.AssetID,
tblCPlogoninfo.Username,
tblCPlogoninfo.Domain) T1 On T1.AssetID = tblAssets.AssetID
Where tblAssetCustom.State = 1
Order By tblAssets.AssetName,
T1.LastLogonTime Desc
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now