‎07-24-2015 07:22 PM
Solved! Go to Solution.
‎07-27-2015 01:21 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblOperatingsystem.Caption As OS,
tsysAssetTypes.AssetTypename As Type,
tblOperatingsystem.ServicePackMajorVersion As SP,
tblAssets.IPAddress,
Case When tsysAssetTypes.AssetType = -1 Then Case
When tblAssetCustom.Serialnumber Like '%virtual%' Or
tblAssetCustom.Model Like '%virtual%' Then 'virtual' Else 'physical' End
End As [Virtual/Physical],
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblAssets.Processor,
tblAssets.Memory As RAM,
tblAssets.Username As [Last user logged on],
tblOperatingsystem.SystemDrive As [OS system drive],
tblState.Statename As State,
tblAssets.Lastseen As [Last scanned],
tblAssetCustom.PurchaseDate,
tblAssetCustom.Warrantydate
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tblOperatingsystem On tblOperatingsystem.AssetID = tblAssets.AssetID
Inner Join tblState On tblState.State = tblAssetCustom.State
Order By tblAssets.AssetName
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Lastseen,
tAVSoftware.softwareName [AV software],
Case When tblAntivirus.onAccessScanningEnabled = 1 Then 'Yes' Else 'No'
End As [Antivirus Enabled],
Case When tblAntivirus.productUpToDate = 1 Then 'Yes' Else 'No'
End As [Antivirus Up To Date],
Case When Coalesce(tAVSoftware.softwareName, '') = '' Then '#FF9999'
Else '#AAFFAA' End As backgroundcolor,
Case When tblAntivirus.onAccessScanningEnabled = 0 Or
tblAntivirus.productUpToDate = 0 Then '#FF0000' Else '#000000'
End As foregroundcolor
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Left Join (Select tblSoftware.AssetID,
tblSoftwareUni.softwareName
From tblSoftware
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Inner Join tsysantivirus On tblSoftwareUni.softwareName Like
tsysantivirus.Software) tAVSoftware On tAVSoftware.AssetID =
tblAssets.AssetID
Left Join tblAntivirus On tblAssets.AssetID = tblAntivirus.AssetID
Where tblAssetCustom.State = 1 And tblAssets.Assettype = -1
Order By tblAssets.AssetName
‎07-27-2015 01:21 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblOperatingsystem.Caption As OS,
tsysAssetTypes.AssetTypename As Type,
tblOperatingsystem.ServicePackMajorVersion As SP,
tblAssets.IPAddress,
Case When tsysAssetTypes.AssetType = -1 Then Case
When tblAssetCustom.Serialnumber Like '%virtual%' Or
tblAssetCustom.Model Like '%virtual%' Then 'virtual' Else 'physical' End
End As [Virtual/Physical],
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblAssets.Processor,
tblAssets.Memory As RAM,
tblAssets.Username As [Last user logged on],
tblOperatingsystem.SystemDrive As [OS system drive],
tblState.Statename As State,
tblAssets.Lastseen As [Last scanned],
tblAssetCustom.PurchaseDate,
tblAssetCustom.Warrantydate
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tblOperatingsystem On tblOperatingsystem.AssetID = tblAssets.AssetID
Inner Join tblState On tblState.State = tblAssetCustom.State
Order By tblAssets.AssetName
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Lastseen,
tAVSoftware.softwareName [AV software],
Case When tblAntivirus.onAccessScanningEnabled = 1 Then 'Yes' Else 'No'
End As [Antivirus Enabled],
Case When tblAntivirus.productUpToDate = 1 Then 'Yes' Else 'No'
End As [Antivirus Up To Date],
Case When Coalesce(tAVSoftware.softwareName, '') = '' Then '#FF9999'
Else '#AAFFAA' End As backgroundcolor,
Case When tblAntivirus.onAccessScanningEnabled = 0 Or
tblAntivirus.productUpToDate = 0 Then '#FF0000' Else '#000000'
End As foregroundcolor
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Left Join (Select tblSoftware.AssetID,
tblSoftwareUni.softwareName
From tblSoftware
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Inner Join tsysantivirus On tblSoftwareUni.softwareName Like
tsysantivirus.Software) tAVSoftware On tAVSoftware.AssetID =
tblAssets.AssetID
Left Join tblAntivirus On tblAssets.AssetID = tblAntivirus.AssetID
Where tblAssetCustom.State = 1 And tblAssets.Assettype = -1
Order By tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now