Notification

Icon
Error

Report of all active PC's (that were connected in the last 30 days)

Posted: Wednesday, July 12, 2017 2:48:32 PM(UTC)
iCe303

iCe303

Member Original PosterPosts: 2
0
Like
Hi all.
New Lansweeper user here, and I'm still learning.
I need to make a quick report of all the computers, there were seen in the last 30 days, and exclude all the computers

I can do a report of computers not seen in at least 30 days, but I can't do the opposite.
I cannot delete old computers / computers that don't exist anymore because of equipment history.

Thank you in advance for any help
Best regards
David.G
#1David.G Member Administration Posts: 114  
posted: 7/12/2017 3:09:12 PM(UTC)
If I understood you correctly, you want to have a report of all assets that have the 'last seen' date updated in the last 30 days. The 'last seen' field only gets updated when an asset is scanned successfully.

I have made a report for Windows computers that have been seen in the last 30 days, i.e. successfully scanned in the last 30 days. Instructions for adding this report to your Lansweeper installation can be found here. If you are interested in building or modifying reports, we do recommend:
  • Reviewing some SQL tutorials, as the Lansweeper report builder is a standard SQL editor. If you know SQL, you know how to build Lansweeper reports as well. This seems like a good tutorial.
  • Making use of our database dictionary, which explains in great detail what each database table and field stores. More information on the dictionary can be found here.
Code:
Select Top 1000000 tblAssets.AssetID,
  tblAssets.AssetName,
  tblAssets.Domain,
  tblAssets.Username,
  tblAssets.Userdomain,
  Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
  tblAssets.IPAddress,
  tsysIPLocations.IPLocation,
  tblAssetCustom.Manufacturer,
  tblAssetCustom.Model,
  tsysOS.OSname As OS,
  tblAssets.SP,
  tblAssets.Lastseen
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
  Inner Join tsysIPLocations On tsysIPLocations.LocationID =
    tblAssets.LocationID
  Inner Join tblState On tblState.State = tblAssetCustom.State
  Left Join tsysOS On tsysOS.OScode = tblAssets.OScode
Where [h]tblAssets.Lastseen > GetDate() - 30[/h] And tblState.Statename = 'Active' And
  tsysAssetTypes.AssetTypename Like 'Windows%'
Order By tblAssets.Domain,
  tblAssets.AssetName

iCe303
#2iCe303 Member Original PosterPosts: 2  
posted: 7/12/2017 4:08:38 PM(UTC)
Thank you so much. It was this kind of report that I needed. Can it be modified to include Mac / OSX?
Thank you once again
Shawn
#3Shawn Member Posts: 1  
posted: 2/13/2020 8:45:37 PM(UTC)
I think this date format works better. For PC's lastseen older than 30 days.

Where tblAssets.Lastseen Between DateAdd(day, -60, Current_TimeStamp) And
DateAdd(day, -31, Current_TimeStamp) And tsysAssetTypes.AssetTypename Like
'Windows%' And tblComputersystem.Domainrole < 2 And tblState.Statename =
'Active'

Active Discussions

Installer Windows 10 Upgrade
by  Michael Kop   Go to last post Go to first unread
Last post: 3/27/2020 4:47:52 PM(UTC)
Installer Uninstall - Adobe Acrobat 9x
by  palemmo  
Go to last post Go to first unread
Last post: 3/25/2020 7:25:05 PM(UTC)
Installer OneDrive Silent Install
by  Steven.C   Go to last post Go to first unread
Last post: 3/13/2020 2:55:19 PM(UTC)
Installer Gotomeeting Desktop
by  TheITGuy  
Go to last post Go to first unread
Last post: 3/12/2020 7:27:48 PM(UTC)
Installer Lenovo System Update
by  TheITGuy   Go to last post Go to first unread
Last post: 3/12/2020 5:43:51 PM(UTC)
Installer KMS Activation: MS Office & Windows
by  Florian_Eigsi  
Go to last post Go to first unread
Last post: 3/3/2020 10:45:41 AM(UTC)
Installer Sophos Silent Install
by  Esben.D   Go to last post Go to first unread
Last post: 2/14/2020 10:41:20 AM(UTC)
Installer Update Windows with PSWindowsUpdate
by  Patrick Kuhl  
Go to last post Go to first unread
Last post: 1/17/2020 5:32:57 PM(UTC)