‎03-04-2017 08:15 PM
‎09-22-2020 04:48 PM
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,
tblOperatingsystem.Caption As [OS version],
tblAssets.SP,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblHyperVGuest.Name As Guest,
OSH.Caption As [Guest OS],
tblHyperVGuest.Memory,
Case tblHyperVGuest.Enabledstate
When 2 Then 'Enabled'
When 3 Then 'Disabled'
When 32768 Then 'Paused'
When 32769 Then 'Suspended'
When 32770 Then 'Starting'
When 32771 Then 'Snapshotting'
When 32773 Then 'Saving'
When 32774 Then 'Stopping'
When 32776 Then 'Pausing'
When 32777 Then 'Resuming'
Else 'Unknown'
End As stateWhenScanned,
Case tblHyperVGuest.Healthstate
When 5 Then 'OK'
When 20 Then 'major failure'
When 25 Then 'critical failure'
Else 'Unknown'
End As Healthstate,
tblHyperVGuest.Lastchanged
From tblAssets
Inner Join tblHyperVGuest On tblAssets.AssetID = tblHyperVGuest.AssetID
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
Inner Join tblOperatingsystem On
tblAssets.AssetID = tblOperatingsystem.AssetID
Left Join tblOperatingsystem As OSH On
OSH.AssetID = tblHyperVGuest.GuestAssetId
Where tblState.Statename = 'Active'
Order By tblAssets.Domain,
tblAssets.AssetName
‎09-22-2020 03:49 PM
‎03-06-2017 04:51 AM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now