‎02-18-2021 10:07 PM
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID As pc_asset_id,
tblAssets.AssetName As pc_asset_name,
tblMonitor.AssetID As monitor_asset_id,
tblMonitor.MonitorManufacturer As [Manufacturer Monitor],
tblMonitor.MonitorModel,
tblMonitor.SerialNumber,
tblMonitor.ManufacturedDate,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress,
tblAssets.Description,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Location,
tblAssetCustom.Custom1 As asset_tag,
tsysIPLocations.IPLocation,
tsysOS.OSname As OS,
tblAssets.SP As SP,
tblAssets.Firstseen,
tblAssets.Lastseen
From tblAssets
Inner Join tblMonitor On tblMonitor.AssetID = tblAssets.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Join tsysIPLocations On tsysIPLocations.StartIP <= tblAssets.IPNumeric
And tsysIPLocations.EndIP >= tblAssets.IPNumeric
Where tblAssetCustom.State = 1
Order By pc_asset_name
Solved! Go to Solution.
‎02-19-2021 06:06 PM
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
monitor.AssetID,
monitor.AssetName
FROM
tblAssets
INNER JOIN tSysAssetTypes AS aType ON aType.AssetType = tblAssets.AssetType AND aType.AssetTypename = 'Windows'
INNER JOIN tblAssetRelations ON tblAssetRelations.ParentAssetID = tblAssets.AssetID
INNER JOIN tblAssets AS monitor ON monitor.AssetID = tblAssetRelations.ChildAssetID
INNER JOIN tSysAssetTypes AS mType ON mType.AssetType = monitor.AssetType AND mType.AssetTypename = 'Monitor'
ORDER BY
tblAssets.AssetName,
monitor.AssetName
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
monitor.AssetID,
monitor.AssetName
FROM
tblAssets
INNER JOIN tblAssetRelations ON tblAssetRelations.ParentAssetID = tblAssets.AssetID
INNER JOIN tblAssets AS monitor ON monitor.AssetID = tblAssetRelations.ChildAssetID AND monitor.AssetType = 208 -- monitor
WHERE
tblAssets.AssetType = -1 -- Windows
ORDER BY
tblAssets.AssetName,
monitor.AssetName
‎04-03-2024 05:26 AM
I need regular inventory by location. While PC's have a location (set by Active Directory OU), it's still leaving out all docking stations and monitors, even though the information is in there. How can those devices all be automatically bulk-set to match the connected computer?
‎02-23-2021 03:33 PM
SELECT
pc.AssetID AS [PC AssetID],
pc.AssetName AS [PC AssetName],
monitor.AssetID AS [Monitor AssetID],
monitor.AssetName AS [Monitor AssetName],
monitorCustom.Model AS [Monitor Model],
monitorCustom.Serialnumber As [Monitor Serial]
FROM
tblAssets AS monitor
LEFT JOIN tblAssetRelations ON tblAssetRelations.ChildAssetID = monitor.AssetID
LEFT JOIN tblAssets AS pc ON pc.AssetID = tblAssetRelations.ParentAssetID AND pc.AssetType = -1
INNER JOIN tblAssetCustom as monitorCustom ON monitorCustom.AssetID = monitor.AssetID
WHERE
monitor.AssetType = 208
ORDER BY
pc.AssetName,
monitor.AssetName,
monitorCustom.SerialNumber
‎02-22-2021 04:20 PM
Select Top 1000000 tblAssets.AssetName As pc_asset_name,
tblAssets.AssetID As pc_asset_id,
monitor.AssetName As monitor_asset_name,
monitor.AssetID As monitor_asset_id,
tblAssetCustom.Custom1 As monitor_asset_tag,
tblAssetCustom.Serialnumber As monitor_serial_number
From tblAssets
Inner Join tblAssetRelations On tblAssetRelations.ParentAssetID =
tblAssets.AssetID
Inner Join tblAssets As monitor On
monitor.AssetID = tblAssetRelations.ChildAssetID And monitor.Assettype = 208
Inner Join tblAssetCustom On monitor.AssetID = tblAssetCustom.AssetID
Where (tblAssets.Assettype = -1 Or tblAssets.Assettype = 208)
Order By pc_asset_name,
monitor_asset_name
‎02-19-2021 06:06 PM
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
monitor.AssetID,
monitor.AssetName
FROM
tblAssets
INNER JOIN tSysAssetTypes AS aType ON aType.AssetType = tblAssets.AssetType AND aType.AssetTypename = 'Windows'
INNER JOIN tblAssetRelations ON tblAssetRelations.ParentAssetID = tblAssets.AssetID
INNER JOIN tblAssets AS monitor ON monitor.AssetID = tblAssetRelations.ChildAssetID
INNER JOIN tSysAssetTypes AS mType ON mType.AssetType = monitor.AssetType AND mType.AssetTypename = 'Monitor'
ORDER BY
tblAssets.AssetName,
monitor.AssetName
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
monitor.AssetID,
monitor.AssetName
FROM
tblAssets
INNER JOIN tblAssetRelations ON tblAssetRelations.ParentAssetID = tblAssets.AssetID
INNER JOIN tblAssets AS monitor ON monitor.AssetID = tblAssetRelations.ChildAssetID AND monitor.AssetType = 208 -- monitor
WHERE
tblAssets.AssetType = -1 -- Windows
ORDER BY
tblAssets.AssetName,
monitor.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now