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

Lansweeper Changes in the licensing model
by  BullGates   Go to last post Go to first unread
Last post: Today at 7:30:32 PM(UTC)
Lansweeper About Memory Changes
by  fjca  
Go to last post Go to first unread
Last post: Today at 5:51:17 PM(UTC)
Lansweeper Wildcard in file scanning to get all files in a directory?
by  RKCar   Go to last post Go to first unread
Last post: Today at 4:03:43 PM(UTC)
Lansweeper Wishlist is dead, no responses from LS staff.
by  RobertB  
Go to last post Go to first unread
Last post: Today at 3:08:12 PM(UTC)
Lansweeper Deploy installer packages not working any more
by  richv   Go to last post Go to first unread
Last post: Today at 3:06:19 PM(UTC)
Lansweeper File Scanning
by  RKCar  
Go to last post Go to first unread
Last post: Today at 2:22:54 PM(UTC)
Lansweeper HP Warranty scan - broken for some products
by  zaty   Go to last post Go to first unread
Last post: Today at 1:52:38 PM(UTC)
Lansweeper How to stop deployments ?
by  Leandro Martins  
Go to last post Go to first unread
Last post: Today at 1:47:22 PM(UTC)