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 All USB devices connected
by  earmor   Go to last post Go to first unread
Last post: Yesterday at 1:35:37 PM(UTC)
Lansweeper Software audit with installation date
by  RC62N   Go to last post Go to first unread
Last post: 7/3/2020 3:39:41 PM(UTC)
Lansweeper Duplicates (3-4) in report please helppppp!
by  AlexMZetec  
Go to last post Go to first unread
Last post: 7/2/2020 3:15:16 PM(UTC)
Lansweeper Report to find all computers with no logon data
by  Andy.S  
Go to last post Go to first unread
Last post: 7/2/2020 9:55:53 AM(UTC)
Lansweeper Change processes report to show opposite results
by  RC62N   Go to last post Go to first unread
Last post: 6/29/2020 9:38:46 PM(UTC)
Lansweeper Keep link to items when using column names
by  Tom Galvin  
Go to last post Go to first unread
Last post: 6/27/2020 12:16:03 AM(UTC)