‎09-19-2018 06:08 PM
‎09-19-2018 10:13 PM
Select Top 100000
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.IPAddress,
tsysAssetTypes.AssetTypename As Type,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.Description,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Location,
tsysIPLocations.IPLocation,
tblAssets.Lastseen,
CASE -- included so you can tell whether the file actually wasn't found or if it just hasn't been checked for yet
WHEN tblFileVersions.Found IS NULL THEN 'Not checked'
WHEN tblFileVersions.Found = 0 THEN 'Not found'
ELSE 'Found' -- filtered out below, but let's be thorough
END AS FilePresent
From
tblAssets
Inner Join tblAssetCustom On tblAssetCustom.AssetID = tblAssets.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tsysIPLocations On tblAssets.IPNumeric >= tsysIPLocations.StartIP And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Inner Join tblSystemEnclosure On tblSystemEnclosure.AssetID = tblAssets.AssetID
Inner Join TsysChassisTypes On TsysChassisTypes.Chassistype = tblSystemEnclosure.ChassisTypes
LEFT Join tblFileVersions On tblAssets.AssetID = tblFileVersions.AssetID And tblFileVersions.FilePathfull Like '%wsscan.exe%'
LEFT Join ( SELECT
tblSoftware.AssetID,
tblSoftwareUni.softwareName
FROM
tblSoftware
INNER JOIN tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID And tblSoftwareUni.softwareName Like 'Dell Data Protection%'
) AS s ON s.AssetID = tblAssets.AssetID
Where
TsysChassisTypes.ChassisName In ('Laptop', 'Portable', 'Notebook')
And (tblFileVersions.Found IS NULL OR tblFileVersions.Found = 0) -- file not found or not yet checked
And (s.AssetID IS NULL) -- AND software not found
And tblAssetCustom.State = 1
Order By
tblAssets.AssetName
‎09-19-2018 07:21 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now