Low Disk Space SQL Query for SCCM
This is a SQL query for your SCCM database or you can use it to create a report using SSRS.
For this work, you must ensure that you have the Logical Disk class enabled in the hardware inventory settings.
This will give you the following information:
- Computer Name
- Disk Description
- Drive Letter
- Volume Name
- File System
- Total Size
- Free Space
SELECT distinct <br /> SYS.Name, <br /> LDSK.Description0 AS [Description], <br /> LDSK.DeviceID0 AS [Drive], <br /> LDSK.VolumeName0 AS [Volume Name], <br /> LDSK.FileSystem0 AS [Filesystem], <br /> LDSK.Size0 AS [Total Size], <br /> LDSK.FreeSpace0 AS [Free Space] <br /> FROM <br /> v_FullCollectionMembership_Valid SYS <br /> JOIN v_GS_LOGICAL_DISK LDSK <br /> on SYS.ResourceID = LDSK.ResourceID <br /> WHERE LDSK.DriveType0 = 3 <br /> AND ((LDSK.FreeSpace0 <= ((LDSK.Size0 * 10)/100)) <br /> or (LDSK.FreeSpace0 <= 1024)) <br /> and sys.CollectionID = 'SMS00001' <br />
If you have any questions about this, please leave a comment below.