‎02-04-2016 08:46 PM
Solved! Go to Solution.
‎02-07-2016 11:20 AM
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblOperatingsystem.Caption As OS,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblCPlogoninfo.logontime As LastLogon,
tblCPlogoninfo.Username,
tblCPlogoninfo.Domain As UserDomain,
tblADusers.Firstname,
tblADusers.Lastname,
tblADusers.Name,
tblADusers.Displayname
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblOperatingsystem
On tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tblCPlogoninfo On tblAssets.AssetID = tblCPlogoninfo.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Left Join tblADusers On tblADusers.Username = tblCPlogoninfo.Username And
tblADusers.Userdomain = tblCPlogoninfo.Domain
Inner Join (Select Top 1000000 tblCPlogoninfo.AssetID,
Max(tblCPlogoninfo.logontime) As Max
From tblCPlogoninfo
Group By tblCPlogoninfo.AssetID) SubQuery On SubQuery.AssetID =
tblCPlogoninfo.AssetID And SubQuery.Max = tblCPlogoninfo.logontime
Where tblAssetCustom.State = 1 And tsysOS.OSname = 'win 7'
Order By tblAssets.Domain,
tblAssets.AssetName
‎02-08-2016 06:18 PM
‎02-07-2016 11:20 AM
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblOperatingsystem.Caption As OS,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblCPlogoninfo.logontime As LastLogon,
tblCPlogoninfo.Username,
tblCPlogoninfo.Domain As UserDomain,
tblADusers.Firstname,
tblADusers.Lastname,
tblADusers.Name,
tblADusers.Displayname
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblOperatingsystem
On tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tblCPlogoninfo On tblAssets.AssetID = tblCPlogoninfo.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Left Join tblADusers On tblADusers.Username = tblCPlogoninfo.Username And
tblADusers.Userdomain = tblCPlogoninfo.Domain
Inner Join (Select Top 1000000 tblCPlogoninfo.AssetID,
Max(tblCPlogoninfo.logontime) As Max
From tblCPlogoninfo
Group By tblCPlogoninfo.AssetID) SubQuery On SubQuery.AssetID =
tblCPlogoninfo.AssetID And SubQuery.Max = tblCPlogoninfo.logontime
Where tblAssetCustom.State = 1 And tsysOS.OSname = 'win 7'
Order By tblAssets.Domain,
tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now