Notification

Icon
Error

Windows: Not seen in the last 30 days (Built-in)

Posted: Thursday, November 20, 2014 11:43:08 AM(UTC)
Daniel.B

Daniel.B

Member Original PosterPosts: 1,150
0
Like
Old name: Computer: Not seen in the last 30 days (Built-in)

The report below lists Windows based assets that were not scanned within the last 30 days

The report will only list assets that meet all of the following criteria:
  • The asset state is set to "active".
  • The asset has been successfully scanned at least once.
  • The asset is a Windows computer.
  • The Last seen date is more than 30 days ago.

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,
  tblAssets.Lasttried,
  tsysAssetTypes.AssetTypename
From tblAssets
  Left Join tsysOS On tsysOS.OScode = tblAssets.OScode
  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
Where tblAssets.Lastseen < GetDate() - 30 And tblState.Statename = 'Active' And
  (tsysAssetTypes.AssetTypename = 'Windows' Or tsysAssetTypes.AssetTypename =
    'Windows CE')
Order By tblAssets.Domain,
  tblAssets.AssetName
Shawn
#1Shawn Member Posts: 4  
posted: 6/24/2020 6:50:46 PM(UTC)
I personally do not want to see assets in the last 30 days, I want to see them older than 30 days. I used the statement below this instead of "Where tblAssets.Lastseen < GetDate() - 30"

Where tblAssets.Lastseen Between DateAdd(day, -999, Current_TimeStamp)
And DateAdd(day, -30, Current_TimeStamp)

Active Discussions

Lansweeper Lost Configuration tab (Admin rights)
by  kspap   Go to last post Go to first unread
Last post: Today at 10:30:12 AM(UTC)
Lansweeper Deployment with different user rights
by  Jupiter_IT  
Go to last post Go to first unread
Last post: Today at 9:39:20 AM(UTC)
Lansweeper cisco fuji device not linking with connected devices
by  char   Go to last post Go to first unread
Last post: Yesterday at 9:12:07 AM(UTC)
Lansweeper Microsoft CVE-2020-1425
by  Richard_B  
Go to last post Go to first unread
Last post: 7/3/2020 4:29:41 PM(UTC)
Lansweeper Wake on Lan in VLANs
by  FrankSc   Go to last post Go to first unread
Last post: 7/3/2020 1:56:46 PM(UTC)
Lansweeper Ticket Closed = email to all helpdesk desk agents
by  Laurent Maene  
Go to last post Go to first unread
Last post: 7/3/2020 1:23:49 PM(UTC)
Lansweeper Helpdek Call Re-Opened
by  pryan67   Go to last post Go to first unread
Last post: 7/3/2020 1:12:17 PM(UTC)
Lansweeper Office 365 32bit vs 64bit?
by  brodiemac-too  
Go to last post Go to first unread
Last post: 7/2/2020 10:35:19 PM(UTC)