→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Xaerie
Engaged Sweeper
I have this report to show only servers, their domain, amount of disk storage being used in GB and GiB, and how much disk storage is available in GB and GiB. I'm having a difficult time getting it to calculate the total usage and capacity of all disks (including all disks provisioned C:, D:, E:...etc.) I can't seem to get accurate numbers, it keeps separating all the disks. I tried removing Caption but that didn't work. Although it's great to see each disk space listed out it's a bit much for what I'm trying to do - which is just to see all my servers disk utilization in GB and GiB without each drive being separate totals.

Is this easy to do using my current query?

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
0 REPLIES 0