cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
gabe
Engaged Sweeper

Hello Everyone


I am currently working on a Report to list the last Logon Time of all our Windows Devices in our Infrastructure and I found this query for it:

Select Top 1000000 UserInfo.Username,
  UserInfo.Domain As Userdomain,
  UserInfo.LastLogon As UserLastLogon,
  tblAssets.AssetID,
  tblAssets.AssetName,
  tblAssets.Domain,
  tblAssets.IPAddress,
  tsysIPLocations.IPLocation,
  tblAssetCustom.Manufacturer,
  tblAssetCustom.Model,
  tsysOS.OSname As OS,
  tblAssets.SP,
  tblAssets.Lastseen,
  tblAssets.Lasttried
From tblAssets
  Inner Join tblCPlogoninfo On tblAssets.AssetID = tblCPlogoninfo.AssetID
  Inner Join (Select Top 1000000 tblCPlogoninfo.Username,
        tblCPlogoninfo.Domain,
        Max(tblCPlogoninfo.logontime) As LastLogon
      From tblCPlogoninfo
        Inner Join tblAssetCustom On tblAssetCustom.AssetID =
          tblCPlogoninfo.AssetID
        Inner Join tblState On tblState.State = tblAssetCustom.State
      Where tblState.Statename = 'Active'
      Group By tblCPlogoninfo.Username,
        tblCPlogoninfo.Domain) As UserInfo On tblCPlogoninfo.Domain =
    UserInfo.Domain And tblCPlogoninfo.logontime = UserInfo.LastLogon And
    tblCPlogoninfo.Username = UserInfo.Username
  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'
Order By Userdomain,
  UserInfo.Username

The query unfortuantely only gives me about 800 Devices, but Lansweeper  shows me that we have over 1400 Windows devices in total. After some comparing my guess is that it only shows devices that are discoverable/online for Lansweeper at that moment. Is it possible to expand this list by all the devices that are currently not reachable for Lansweeper, meaning every single device?

I already tried to remove the "Active"-Flag, but it did not work.

Thank you for your help.

Kind regards,

 


Gabriel

1 REPLY 1
ErikT
Lansweeper Tech Support
Lansweeper Tech Support

@gabe, I updated your post adding the Finished Reports and Report Center labels so that your post will get more traction.