Notification

Icon
Error

Windows: Workstations less than 10% free disk space (Built-in)

Posted: Tuesday, August 8, 2017 5:36:12 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 workstation computers with a hard drives that has less than 10% space.

The report will only list assets that meet all of the following criteria:
  • The asset state is set to "active".
  • The asset has been successfully scanned at least once.
  • The asset is a Windows computer.

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,
  Ceiling(tblDiskdrives.Freespace / (Case tblDiskdrives.Size When 0 Then 1
    Else tblDiskdrives.Size End) * 100) As [%SpaceLeft],
  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.Size / 1024 / 1024 / 1024 As numeric) <> 0 And
  Ceiling(tblDiskdrives.Freespace / (Case tblDiskdrives.Size When 0 Then 1
    Else tblDiskdrives.Size
  End) * 100) < 10 And tblState.Statename = 'Active' And
  tblDomainroles.Domainrolename In ('Stand-alone workstation',
  'Member workstation') And Case tblDiskdrives.DriveType
    When 3 Then 'Local Disk' End = 'Local Disk'
Order By tblAssets.Domain,
  tblAssets.AssetName,
  Drive

Active Discussions

Lansweeper Duplicate Users On report
by  RC62N   Go to last post Go to first unread
Last post: Today at 3:51:07 PM(UTC)
Lansweeper Local Admin Group Members
by  ggbce  
Go to last post Go to first unread
Last post: Today at 2:28:50 PM(UTC)
Lansweeper Last used system of users in a specific OU
by  chriscornelis   Go to last post Go to first unread
Last post: Yesterday at 11:11:35 AM(UTC)
Lansweeper Trying to display different versions of software
by  TimHolmes1973  
Go to last post Go to first unread
Last post: 10/28/2020 8:54:04 PM(UTC)
Lansweeper Switch & Port reports - SNMPInfo tables missing info
by  Maxlieb   Go to last post Go to first unread
Last post: 10/28/2020 1:02:24 PM(UTC)
Lansweeper Last Patch Date
by  Dan S   Go to last post Go to first unread
Last post: 10/26/2020 2:27:47 PM(UTC)
Lansweeper Webcam report, the wrong way
by  TimHolmes1973  
Go to last post Go to first unread
Last post: 10/23/2020 4:38:45 PM(UTC)