SCCM 2012 R2 – Free disk space report

Hi All,

a customer of mine called today and asked my help to build a report that shows machines with low disk space…

it is a really simple and i had already the query all machines with Low Disk space (below 10%) as well as critical disk space (below 1GB).

I created the report and while testing, it was not working. Looking on the database, the FreeSpace0 column was null…

an easy fix was to change the hardware inventory, logical disk class and selecting Free Space (MB). Once it was done and the client sent the new inventory, the report started working

SQL Query:

SELECT distinct
SYS.Name,
LDISK.Description0,
LDISK.DeviceID0,
LDISK.VolumeName0,
LDISK.FileSystem0,
LDISK.Size0,
LDISK.FreeSpace0,
sys.SiteCode
FROM
v_FullCollectionMembership_Valid SYS
join v_GS_LOGICAL_DISK LDISK on SYS.ResourceID = LDISK.ResourceID
WHERE LDISK.DriveType0 = 3 AND ((LDISK.FreeSpace0 <= ((LDisk.Size0 * 10)/100)) or (LDISK.FreeSpace0 <= 1024)) and sys.CollectionID = ‘SMS00001′

 

email

Written by , Posted .