Notification

Icon
Error

Windows: Servers less than 5GB free disk space (Built-in)

Posted: Tuesday, August 8, 2017 4:25:08 PM(UTC)
Nick.VDB

Nick.VDB

Member Lansweeper Developer Administration Original PosterPosts: 251
0
Like
Added in v.6.0.100

The report below lists Windows server computers that have less that 5GB free on their hard disk.

The report will only list assets that meet all of the following criteria:
  • The computer's state is set to "active".
  • The computer has been successfully scanned at least once
  • The asset is a Windows computer.
  • The asset has a server domain role
  • The asset has a hard drive with less than 5GB free

Code:

Select Top 1000000 tblAssets.AssetID,
  tblAssets.AssetName,
  tblAssets.Domain,
  tblAssets.Username,
  tblAssets.Userdomain,
  Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
  tblAssets.IPAddress,
  tsysIPLocations.IPLocation,
  tblAssetCustom.Manufacturer,
  tblAssetCustom.Model,
  tsysOS.OSname As OS,
  tblAssets.SP,
  tblAssets.Lastseen,
  tblAssets.Lasttried,
  tblDiskdrives.Caption As Drive,
  Cast(tblDiskdrives.Freespace / 1024 / 1024 / 1024 As numeric) As FreeGB,
  Cast(tblDiskdrives.Size / 1024 / 1024 / 1024 As numeric) As TotalSizeGB,
  tblDiskdrives.Lastchanged As LastChanged
From tblAssets
  Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
  Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tblState On tblState.State = tblAssetCustom.State
  Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
  Inner Join tsysIPLocations On tsysIPLocations.LocationID =
    tblAssets.LocationID
  Inner Join tblDomainroles On tblDomainroles.Domainrole =
    tblComputersystem.Domainrole
  Left Join tsysOS On tblAssets.OScode = tsysOS.OScode
Where Cast(tblDiskdrives.Freespace / 1024 / 1024 / 1024 As numeric) < 5 And
  Cast(tblDiskdrives.Size / 1024 / 1024 / 1024 As numeric) <> 0 And
  Cast(tblDiskdrives.Size / 1024 / 1024 / 1024 As numeric) > 5 And
  tblState.Statename = 'Active' And tblDomainroles.Domainrolename In
  ('Stand-alone server', 'Member server', 'Primary domain controller',
  'Backup domain controller') And Case tblDiskdrives.DriveType
    When 3 Then 'Local Disk' End = 'Local Disk'
Order By tblAssets.Domain,
  tblAssets.AssetName,
  Drive

Active Discussions

Lansweeper Is there a limit to the number of incoming mail domains?
by  DrewT  
Go to last post Go to first unread
Last post: Today at 1:33:44 PM(UTC)
Lansweeper License renewal - but why
by  mrusso   Go to last post Go to first unread
Last post: Yesterday at 5:01:47 PM(UTC)
Lansweeper Deployment Package Error Message
by  Brandon  
Go to last post Go to first unread
Last post: Yesterday at 2:04:25 PM(UTC)
Lansweeper Asset Type Mail Server
by  MarkPayton   Go to last post Go to first unread
Last post: Yesterday at 1:03:54 PM(UTC)
Lansweeper Upgrade Win 10 build to version 2004
by  Jean-FB  
Go to last post Go to first unread
Last post: 10/28/2020 7:34:29 PM(UTC)
Lansweeper Uptime only shows Standby
by  Gst4r   Go to last post Go to first unread
Last post: 10/28/2020 4:19:33 PM(UTC)
Lansweeper Excepciones
by  Pablo  
Go to last post Go to first unread
Last post: 10/27/2020 7:35:21 PM(UTC)