Notification

Icon
Error

Windows: Laptops and desktops list (Built-in)

Posted: Tuesday, August 8, 2017 3:58:23 PM(UTC)
Nick.VDB

Nick.VDB

Member Lansweeper Developer Administration Original PosterPosts: 251
1
Like
Added in v.6.0.100

The report below lists Windows computers and gives back if the asset is a laptop or desktop.

The report will only list assets that meet all of the following criteria:
  • The computer's state is set to "active".
  • The computer has been successfully scanned at least once.
  • The asset is a Windows computer.

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,
  Case When tblPortableBattery.AssetID Is Null Then 'Desktop' Else 'Laptop'
  End As [Desktop/Laptop]
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
  Left Join tblPortableBattery On tblAssets.AssetID = tblPortableBattery.AssetID
Where (tblAssetCustom.Model Is Null Or tblAssetCustom.Model = '' Or
    tblAssetCustom.Model Not Like '%Virtual%') And
  tblAssets.Lastseen Is Not Null And tblAssets.Lastseen <> '' And
  tblState.Statename = 'Active' And tsysAssetTypes.AssetTypename In ('Windows',
  'Windows CE')
Order By tblAssets.Domain,
  tblAssets.AssetName
MrOctober67
#1MrOctober67 Member Posts: 1  
posted: 3/6/2020 2:40:48 PM(UTC)
Much appreciated you saved me hours of doing this on my own
FrgnAlex
#2FrgnAlex Member Posts: 1  
posted: 10/30/2020 10:35:11 PM(UTC)
I get a whole bunch of duplicates when I run this.
Anyone know how to go UNIQUE? It errors when I added that to the SELECT statement

Active Discussions

Lansweeper LsAgent for Windows command line options?
by  Brandon   Go to last post Go to first unread
Last post: Yesterday at 4:49:17 PM(UTC)
Lansweeper EmailLog.txt file become big in size
by  Ary Ahmed  
Go to last post Go to first unread
Last post: 4/18/2021 10:56:58 AM(UTC)
Lansweeper LsAgent.ini
by  Orion Poplawski   Go to last post Go to first unread
Last post: 4/17/2021 4:49:12 PM(UTC)
Lansweeper LSagent force a scan
by  Orion Poplawski  
Go to last post Go to first unread
Last post: 4/17/2021 4:46:49 PM(UTC)
Lansweeper MS Edge Chromium LanSweeper Extension development
by  steveb   Go to last post Go to first unread
Last post: 4/16/2021 10:59:56 PM(UTC)
Lansweeper Office 365 v2 Scanning Error
by  DJX  
Go to last post Go to first unread
Last post: 4/16/2021 7:37:57 PM(UTC)
Lansweeper Database size growing too large
by  JTempleton   Go to last post Go to first unread
Last post: 4/16/2021 5:19:22 PM(UTC)
Lansweeper Limit New Ticket Notifications
by  Jeff WP  
Go to last post Go to first unread
Last post: 4/16/2021 4:40:43 PM(UTC)