Notification

Icon
Error

Asset: Duplicate Serial Number (Built-in)

Posted: Tuesday, November 18, 2014 4:29:43 PM(UTC)
Bart.M

Bart.M

Member Original PosterPosts: 13
0
Like
The report below gives back a list of active assets having a serial number found more than once among the active assets.

The report will only list assets that meet all of the following criteria:
  • The asset is a Windows computer
  • The computer has an empty or duplicate serial number
  • The computer's state is set to 'Active'
  • The computer has been successfully scanned at least once


Code:
Select Top 1000000 tblAssets.AssetID,
  tblAssets.AssetName,
  tblAssets.Domain,
  tsysAssetTypes.AssetTypename As AssetType,
  tblAssets.Username,
  tblAssets.Userdomain,
  Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
  tblAssets.IPAddress,
  tsysIPLocations.IPLocation,
  tblAssetCustom.Manufacturer,
  tblAssetCustom.Model,
  Coalesce(tsysOS.OSname, tblMacOSInfo.SystemVersion, tblLinuxSystem.OSRelease)
  As OS,
  tblAssets.SP,
  tblAssets.Lastseen,
  tblAssets.Lasttried,
  tblAssetCustom.Serialnumber
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
  Left Join tblMacOSInfo On tblAssets.AssetID = tblMacOSInfo.AssetID
  Left Join tblLinuxSystem On tblAssets.AssetID = tblLinuxSystem.AssetID
  Inner Join (Select Count(tblAssetCustom.AssetID) As Total,
    Coalesce(tblAssetCustom.Serialnumber, N'') As Serial
  From tblAssetCustom
  Where tblAssetCustom.State = 1
  Group By Coalesce(tblAssetCustom.Serialnumber, N'')
  Having Count(tblAssetCustom.AssetID) > 1 And
    Coalesce(tblAssetCustom.Serialnumber, N'') <> '') As Duplicates
    On tblAssetCustom.Serialnumber = Duplicates.Serial
Where tblState.Statename = 'Active'
Order By tblAssets.IPNumeric,
tblAssets.Domain,
  tblAssets.AssetName
brodiemac-too
#1brodiemac-too Member Posts: 29  
posted: 8/5/2020 1:28:56 PM(UTC)
Is there any way to include assets that are anything other than active? I'm finding some of our inventory being deployed is creating a new asset when re-imaged and I need to identify them. I changed
Code:
Where tblState.Statename = 'Active'

to
Code:
Where tblState.Statename <> 'Junk'

Junk is a state we added for assets to be disposed of. Regardless, the report is missing some assets. Any ideas what I am doing wrong here?

Active Discussions

Lansweeper Lansweeper Fresh Install Hanging, High CPU, Unusable
by  ebars   Go to last post Go to first unread
Last post: Yesterday at 7:53:38 PM(UTC)
Lansweeper Forwarding tickets to regular email recipents
by  ChristerT  
Go to last post Go to first unread
Last post: Yesterday at 9:48:15 AM(UTC)
Lansweeper Outlook task and calendar
by  Squack the Duck   Go to last post Go to first unread
Last post: Yesterday at 12:40:37 AM(UTC)
Lansweeper Cap on number of routers?
by  MarkPayton  
Go to last post Go to first unread
Last post: 11/23/2020 10:04:12 PM(UTC)
Lansweeper Authenticate from CLI
by  blunderdog   Go to last post Go to first unread
Last post: 11/23/2020 9:57:04 PM(UTC)
Lansweeper Bulk Computer Import
by  CWInfo  
Go to last post Go to first unread
Last post: 11/23/2020 8:33:38 PM(UTC)
Lansweeper Automated warranty check not working for HP
by  JérômeS   Go to last post Go to first unread
Last post: 11/23/2020 3:17:48 PM(UTC)
Lansweeper Does LSPush Scan pull Bitlocker Protection Information
by  MDahitule  
Go to last post Go to first unread
Last post: 11/23/2020 3:05:34 PM(UTC)