cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
magson
Engaged Sweeper II
Hi All,

I am having issues adding OU and computer model to the following Hard drive size report.

please can someone assist? here is the SQL i am using for HDD size



Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
Sum(Cast(Cast(tblDiskdrives.Size As BigInt) / 1024 / 1024 / 1024 As Numeric))
As [Total size (GB)],
Sum(Cast(Cast(tblDiskdrives.Freespace As BigInt) / 1024 / 1024 /
1024 As Numeric)) As [Free in GB]
From tblAssets
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Group By tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Lastseen
Order By tblAssets.AssetID
1 REPLY 1
RCorbeil
Honored Sweeper II
It's worth reading through the database documentation.

The asset's make/model/serial/etc. are found in tblAssetCustom. The asset's AD info is found in tblADComputers.
Select Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
Sum(Cast(Cast(tblDiskdrives.Size As BigInt) / 1024 / 1024 / 1024 As Numeric)) As [Total size (GB)],
Sum(Cast(Cast(tblDiskdrives.Freespace As BigInt) / 1024 / 1024 / 1024 As Numeric)) As [Free in GB],
tblAssetCustom.Model,
tblADComputers.OU
From
tblAssets
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblADComputers ON tblAssets.AssetID = tblADComputers.AssetID
Group By
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Lastseen,
tblAssetCustom.Model,
tblADComputers.OU
Order By
tblAssets.AssetID