‎09-15-2020 09:52 AM
Select Top 1000000 tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysAssetTypes.AssetTypename,
tsysOS.OSname,
tblAssetCustom.Model,
tblDiskdrives.Caption,
tblDiskdrives.FileSystem,
tblDiskdrives.Description,
tblDiskdrives.DriveType,
Cast(tblDiskdrives.Size / Power(10, 9) As Numeric(8,2)) As [Capacity (GB)],
Cast(tblDiskdrives.Freespace / Power(10, 9) As Numeric(8,2)) As [Free (GB)],
Cast((tblDiskdrives.Size - tblDiskdrives.Freespace) / Power(10,
9) As Numeric(8,2)) As [Used (GB)],
Cast(tblDiskdrives.Size / Power(2, 30) As Numeric(8,2)) As [Capacity (GiB)],
Cast(tblDiskdrives.Freespace / Power(2, 30) As Numeric(8,2)) As [Free (GiB)],
Cast((tblDiskdrives.Size - tblDiskdrives.Freespace) / Power(2,
30) As Numeric(8,2)) As [Used (GiB)],
Cast((tblDiskdrives.Size - tblDiskdrives.Freespace) / tblDiskdrives.Size *
100 As Numeric(8,2)) As [Used %],
Cast((tblDiskdrives.Size - tblDiskdrives.Freespace) / tblDiskdrives.Size *
100 As Decimal(8,2)) As [Pct Used],
tblDiskdrives.Volumename,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblDomainroles.Domainrolename
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblDomainroles On tblDomainroles.Domainrole =
tblComputersystem.Domainrole
Inner Join tblDiskdrives On tblDiskdrives.AssetID = tblAssets.AssetID And
tblDiskdrives.DriveType = 3
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Where tblAssetCustom.State = 1 And tblComputersystem.Domainrole > 1
Order By tblAssets.AssetUnique,
tblDiskdrives.Caption,
tblAssets.Domain
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now