‎02-02-2018 04:57 PM
‎02-02-2018 06:12 PM
Select Top 1000000 t.Username,
t.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tsysOS.OSname As OS,
tblAssets.SP,
tblAssets.Lastseen,
tblAssets.Lasttried,
t.Domain As Userdomain,
t.logontime As LogonTime
from (select logontime, username, domain, assetid, row_number() over(partition by assetid order by logontime desc) as rn
from tblCPlogoninfo) as T
inner join tblassets on tblassets.assetid = t.assetid
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tsysIPLocations On tsysIPLocations.LocationID = tblAssets.LocationID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblState On tblState.State = tblAssetCustom.State
Left Join tsysOS On tblAssets.OScode = tsysOS.OScode
Where tblState.Statename = 'Active' and rn = 1
order by t.Username,
tblAssets.AssetName,
tblAssets.Domain,
LogonTime
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now