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: 4  
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

Lansweeper Understanding current setup
by  ggarcia   Go to last post Go to first unread
Last post: Today at 12:24:42 AM(UTC)
Lansweeper Remote desktop custom port
by  sefaucher  
Go to last post Go to first unread
Last post: Yesterday at 10:30:49 PM(UTC)
Lansweeper Unable to transfer user's data prior to removal
by  RickW99456   Go to last post Go to first unread
Last post: Yesterday at 9:06:14 PM(UTC)
Lansweeper Unable to access the lansweeper consol for other computer
by  Kudnan Ingle  
Go to last post Go to first unread
Last post: Yesterday at 7:49:32 PM(UTC)
Lansweeper Closing and re-opening of tickets
by  NWHiker   Go to last post Go to first unread
Last post: Yesterday at 3:42:56 PM(UTC)
Lansweeper Wake on Lan Issues
by  woldummy  
Go to last post Go to first unread
Last post: Yesterday at 3:42:07 PM(UTC)
Lansweeper Deploy and start Software
by  EDV_OHZ   Go to last post Go to first unread
Last post: Yesterday at 12:49:08 PM(UTC)
Lansweeper Helpdek Call Re-Opened
by  mouaad  
Go to last post Go to first unread
Last post: Yesterday at 7:30:59 AM(UTC)