‎08-08-2017 04:27 PM
Solved! Go to Solution.
‎08-09-2017 11:51 AM
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
Sum(Convert(Decimal(7,2),tblDiskdrives.Size / 1024 / 1024 / 1024)) As TotalGB,
Sum(Convert(Decimal(7,2),tblDiskdrives.Freespace / 1024 / 1024 /
1024)) As FreeGB,
Sum(Convert(Decimal(7,2),tblDiskdrives.Size / 1024 / 1024 / 1024) -
Convert(Decimal(7,2),tblDiskdrives.Freespace / 1024 / 1024 / 1024)) As UsedGB
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblDomainroles On tblDomainroles.Domainrole =
tblComputersystem.Domainrole
Where tblDiskdrives.DriveType = 3 And tblDomainroles.Domainrolename In
('Stand-alone server', 'Member server', 'Primary domain controller',
'Backup domain controller')
Group By tsysOS.Image,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress
Order By tblAssets.Domain,
tblAssets.AssetName
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
Sum(Convert(Decimal(7,2),tblDiskdrives.Size / 1024 / 1024 / 1024)) As TotalGB,
Sum(Convert(Decimal(7,2),tblDiskdrives.Freespace / 1024 / 1024 /
1024)) As FreeGB,
Sum(Convert(Decimal(7,2),tblDiskdrives.Size / 1024 / 1024 / 1024) -
Convert(Decimal(7,2),tblDiskdrives.Freespace / 1024 / 1024 / 1024)) As UsedGB
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblDomainroles On tblDomainroles.Domainrole =
tblComputersystem.Domainrole
Where tblDiskdrives.DriveType = 3 And tblDomainroles.Domainrolename In
('Stand-alone workstation', 'Member workstation')
Group By tsysOS.Image,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress
Order By tblAssets.Domain,
tblAssets.AssetName
‎08-09-2017 11:52 PM
‎08-09-2017 11:51 AM
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
Sum(Convert(Decimal(7,2),tblDiskdrives.Size / 1024 / 1024 / 1024)) As TotalGB,
Sum(Convert(Decimal(7,2),tblDiskdrives.Freespace / 1024 / 1024 /
1024)) As FreeGB,
Sum(Convert(Decimal(7,2),tblDiskdrives.Size / 1024 / 1024 / 1024) -
Convert(Decimal(7,2),tblDiskdrives.Freespace / 1024 / 1024 / 1024)) As UsedGB
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblDomainroles On tblDomainroles.Domainrole =
tblComputersystem.Domainrole
Where tblDiskdrives.DriveType = 3 And tblDomainroles.Domainrolename In
('Stand-alone server', 'Member server', 'Primary domain controller',
'Backup domain controller')
Group By tsysOS.Image,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress
Order By tblAssets.Domain,
tblAssets.AssetName
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
Sum(Convert(Decimal(7,2),tblDiskdrives.Size / 1024 / 1024 / 1024)) As TotalGB,
Sum(Convert(Decimal(7,2),tblDiskdrives.Freespace / 1024 / 1024 /
1024)) As FreeGB,
Sum(Convert(Decimal(7,2),tblDiskdrives.Size / 1024 / 1024 / 1024) -
Convert(Decimal(7,2),tblDiskdrives.Freespace / 1024 / 1024 / 1024)) As UsedGB
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblDomainroles On tblDomainroles.Domainrole =
tblComputersystem.Domainrole
Where tblDiskdrives.DriveType = 3 And tblDomainroles.Domainrolename In
('Stand-alone workstation', 'Member workstation')
Group By tsysOS.Image,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress
Order By tblAssets.Domain,
tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now