‎11-24-2014 10:29 PM
Solved! Go to Solution.
‎11-27-2014 12:02 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tsysOS.Image As icon,
tblAssets.Domain,
tsysOS.OSname,
tsysAssetTypes.AssetTypename As Type,
tblAssets.SP,
tblAssets.IPAddress As [IP Address],
Case When tblAssetCustom.Model Like '%virtual%' Then 'virtual' Else 'physical'
End As [virtual/physical],
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber As Serial,
tblAssets.Processor,
tblAssets.NrProcessors As #CPU,
Sum(tblProcessor.NumberOfLogicalProcessors) As [Logical Processors],
Cast(Cast(Sum(tblPhysicalMemory.Capacity) As bigint) / 1024 / 1024 As numeric)
As RAM,
tblAssets.Userdomain + '\' + tblAssets.Username As [Last logged on],
tblAssets.Lastseen,
SubQuery1.HyperVhost As [Hyper-V Host]
From tblAssets
Left Outer Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblProcessor On tblAssets.AssetID = tblProcessor.AssetID
Inner Join tblPhysicalMemory On tblAssets.AssetID = tblPhysicalMemory.AssetID
Left Join (Select Top 1000000 tblAssets.AssetID,
tblAssets1.AssetName As HyperVhost
From tblAssets
Inner Join tblAssetMacAddress
On tblAssets.AssetID = tblAssetMacAddress.AssetID
Inner Join TblHyperVGuestNetwork On TblHyperVGuestNetwork.MacAddress =
tblAssetMacAddress.Mac
Left Join tblHyperVGuest On TblHyperVGuestNetwork.HyperVGuestID =
tblHyperVGuest.hypervguestID
Left Join tblAssets tblAssets1 On tblAssets1.AssetID =
tblHyperVGuest.AssetID) SubQuery1 On SubQuery1.AssetID = tblAssets.AssetID
Where tblAssetCustom.State = 1
Group By tblAssets.AssetID,
tblAssets.AssetUnique,
tsysOS.Image,
tblAssets.Domain,
tsysOS.OSname,
tsysAssetTypes.AssetTypename,
tblAssets.SP,
tblAssets.IPAddress,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblAssets.Processor,
tblAssets.NrProcessors,
tblAssets.Lastseen,
SubQuery1.HyperVhost,
tblAssets.Userdomain,
tblAssets.Username
Order By tblAssets.AssetID
‎09-02-2016 01:45 AM
‎11-28-2014 02:54 PM
‎11-27-2014 12:02 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tsysOS.Image As icon,
tblAssets.Domain,
tsysOS.OSname,
tsysAssetTypes.AssetTypename As Type,
tblAssets.SP,
tblAssets.IPAddress As [IP Address],
Case When tblAssetCustom.Model Like '%virtual%' Then 'virtual' Else 'physical'
End As [virtual/physical],
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber As Serial,
tblAssets.Processor,
tblAssets.NrProcessors As #CPU,
Sum(tblProcessor.NumberOfLogicalProcessors) As [Logical Processors],
Cast(Cast(Sum(tblPhysicalMemory.Capacity) As bigint) / 1024 / 1024 As numeric)
As RAM,
tblAssets.Userdomain + '\' + tblAssets.Username As [Last logged on],
tblAssets.Lastseen,
SubQuery1.HyperVhost As [Hyper-V Host]
From tblAssets
Left Outer Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblProcessor On tblAssets.AssetID = tblProcessor.AssetID
Inner Join tblPhysicalMemory On tblAssets.AssetID = tblPhysicalMemory.AssetID
Left Join (Select Top 1000000 tblAssets.AssetID,
tblAssets1.AssetName As HyperVhost
From tblAssets
Inner Join tblAssetMacAddress
On tblAssets.AssetID = tblAssetMacAddress.AssetID
Inner Join TblHyperVGuestNetwork On TblHyperVGuestNetwork.MacAddress =
tblAssetMacAddress.Mac
Left Join tblHyperVGuest On TblHyperVGuestNetwork.HyperVGuestID =
tblHyperVGuest.hypervguestID
Left Join tblAssets tblAssets1 On tblAssets1.AssetID =
tblHyperVGuest.AssetID) SubQuery1 On SubQuery1.AssetID = tblAssets.AssetID
Where tblAssetCustom.State = 1
Group By tblAssets.AssetID,
tblAssets.AssetUnique,
tsysOS.Image,
tblAssets.Domain,
tsysOS.OSname,
tsysAssetTypes.AssetTypename,
tblAssets.SP,
tblAssets.IPAddress,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblAssets.Processor,
tblAssets.NrProcessors,
tblAssets.Lastseen,
SubQuery1.HyperVhost,
tblAssets.Userdomain,
tblAssets.Username
Order By tblAssets.AssetID
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now