‎05-15-2013 07:13 PM
Solved! Go to Solution.
‎05-16-2013 09:02 PM
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblDiskdrives.Caption,
Ceiling(tblDiskdrives.Freespace / 1024 / 1024) As FreeMB,
Ceiling((tblDiskdrives.Size / 1024 / 1024) - (tblDiskdrives.Freespace / 1024 /
1024)) As UsedMB,
Ceiling(tblDiskdrives.Size / 1024 / 1024) As TotalMB,
tblAssets.Firstseen,
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Where tblAssetCustom.State = 1 And tblComputersystem.Domainrole > 1 And
tblDiskdrives.DriveType = 3
Order By tblAssets.Domain,
tblAssets.AssetName,
tblDiskdrives.Caption
‎05-16-2013 10:37 PM
‎05-16-2013 10:16 PM
‎05-16-2013 10:15 PM
Select Top 1000000
ServerDrives.icon,
ServerDrives.AssetID,
ServerDrives.AssetUnique,
ServerDrives.Domain,
ServerDrives.Description,
ServerDrives.Lastseen,
ServerDrives.Drive,
ServerDrives.FileSystem,
ServerDrives.[Capacity GB],
ServerDrives.[Used GB],
ServerDrives.[Free GB]
From
( Select Top 1000000
tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetUnique,
tblAssets.Domain,
tblAssets.Description,
tblAssets.Lastseen,
tblDiskdrives.Caption As Drive,
tblDiskdrives.Caption As SortDrive,
tblDiskdrives.FileSystem,
Ceiling(tblDiskdrives.Size / 1000 / 1000 / 1000) As [Capacity GB],
Ceiling((tblDiskdrives.Size - tblDiskdrives.Freespace) / 1000 / 1000 / 1000) As [Used GB],
Ceiling(tblDiskdrives.Freespace / 1000 / 1000 / 1000) As [Free GB]
From
tblAssets
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblDiskdrives On tblDiskdrives.AssetID = tblAssets.AssetID
Where
tblAssetCustom.State = 1
And tblComputersystem.Domainrole >= 2
And tblDiskdrives.DriveType = 3
Union All
Select Top 1000000
tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetUnique,
tblAssets.Domain,
tblAssets.Description,
tblAssets.Lastseen,
'TOTAL' As Drive,
'zzz' As SortDrive,
Null,
Ceiling( ( Select Sum(AllDrives.Size)
From tblDiskdrives As AllDrives
Where AllDrives.AssetID = tblAssets.AssetID
And AllDrives.DriveType = 3) / 1000 / 1000 / 1000) As [Capacity GB],
Ceiling( ( Select Sum(AllDrives.Size - AllDrives.Freespace)
From tblDiskdrives As AllDrives
Where AllDrives.AssetID = tblAssets.AssetID
And AllDrives.DriveType = 3) / 1000 / 1000 / 1000) As [Used GB],
Ceiling ( (Select Sum(AllDrives.Freespace)
From tblDiskdrives As AllDrives
Where AllDrives.AssetID = tblAssets.AssetID
And AllDrives.DriveType = 3) / 1000 / 1000 / 1000) As [Free GB]
From
tblAssets
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Where
tblAssetCustom.State = 1
And tblComputersystem.Domainrole >= 2
) As ServerDrives
Order By
ServerDrives.AssetUnique,
ServerDrives.SortDrive
‎05-16-2013 09:55 PM
‎05-16-2013 09:02 PM
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblDiskdrives.Caption,
Ceiling(tblDiskdrives.Freespace / 1024 / 1024) As FreeMB,
Ceiling((tblDiskdrives.Size / 1024 / 1024) - (tblDiskdrives.Freespace / 1024 /
1024)) As UsedMB,
Ceiling(tblDiskdrives.Size / 1024 / 1024) As TotalMB,
tblAssets.Firstseen,
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Where tblAssetCustom.State = 1 And tblComputersystem.Domainrole > 1 And
tblDiskdrives.DriveType = 3
Order By tblAssets.Domain,
tblAssets.AssetName,
tblDiskdrives.Caption
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now