‎04-24-2019 12:01 PM
Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.Username,
Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
tblAssets.IPAddress,
CPU.[CPU speed],
RAM.RAM,
Case
When tblAssets.AssetID = freespace.AssetID Then 'OK'
Else 'Not OK'
End As [Disk space],
tsysOS.OSname As OS,
tblAssets.SP,
tblComputersystem.SystemType As Architecture,
Case
When tsysOS.OSname = 'Win 7' And tblAssets.SP = 1 And RAM.RAM = 'OK' And
CPU.[CPU speed] = 'OK' And tblAssets.AssetID = freespace.AssetID
Then 'Yes'
When tsysOS.OSname Like '%8.1%' And RAM.RAM = 'OK' And CPU.[CPU speed] =
'OK' And tblAssets.AssetID = freespace.AssetID Then 'Yes'
Else 'No'
End As [In-place upgrade ready],
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tsysIPLocations.IPLocation,
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
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
Left Join (Select Top 1000000 tblAssets.AssetID,
Case
When tblProcessor.MaxClockSpeed > 1000 Then 'OK'
Else 'Not OK'
End As [CPU speed]
From tblAssets
Inner Join tblProcessor On tblAssets.AssetID = tblProcessor.AssetID) As
CPU On CPU.AssetID = tblAssets.AssetID
Left Join (Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblComputersystem.SystemType,
Sum(Cast(Cast(tblPhysicalMemory.Capacity As bigint) / 1024 /
1024 As numeric)) As Memory,
Case
When tblComputersystem.SystemType Like '%64%' And
Sum(Cast(Cast(tblPhysicalMemory.Capacity As bigint) / 1024 /
1024 As numeric)) >= 2048 Then 'OK'
When tblComputersystem.SystemType Like '%86%' And
Sum(Cast(Cast(tblPhysicalMemory.Capacity As bigint) / 1024 /
1024 As numeric)) >= 1024 Then 'OK'
Else 'Not OK'
End As RAM
From tblAssets
Inner Join tblComputersystem On
tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblPhysicalMemory On
tblAssets.AssetID = tblPhysicalMemory.AssetID
Group By tblAssets.AssetID,
tblAssets.AssetName,
tblComputersystem.SystemType,
tblAssets.Memory) As RAM On RAM.AssetID = tblAssets.AssetID
Left Join (Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
Cast(Cast(tblDiskdrives.Freespace As bigint) / 1024 / 1024 As numeric)
As free,
tblComputersystem.SystemType
From tblAssets
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tblComputersystem On
tblAssets.AssetID = tblComputersystem.AssetID
Where (Cast(Cast(tblDiskdrives.Freespace As bigint) / 1024 /
1024 As numeric) > 32000 And tblComputersystem.SystemType Like '%64%')
Or
(Cast(Cast(tblDiskdrives.Freespace As bigint) / 1024 / 1024 As
numeric) > 16000 And tblComputersystem.SystemType Like '%86%')) As
freespace On freespace.AssetID = tblAssets.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Where tsysOS.OSname <> 'Win 10' And tblState.Statename = 'Active' And
tblComputersystem.Domainrole < 2
Order By tblAssets.Domain,
tblAssets.AssetName
‎05-16-2019 03:49 PM
‎05-10-2019 02:55 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now