REVIEWED by Sophos
Often when a user complains about a device being slow or having problems the first thing to check is how much free disk space does the device have.
You can use this to monitor the devices under management to determine if you should go in and clean stuff up or not.
SELECT device_id Drive, description, boot_partition, file_system, printf("%.2f", (CAST (free_space AS FLOAT)/CAST(size AS FLOAT) ) * 100.0 ) || '%' Percent_Free, printf("%.2f", CAST(free_space AS FLOAT)/1024.0/1024.0/1024.0) 'Free_Space(GB)', printf("%.2f", CAST(size AS FLOAT)/1024.0/1024.0/1024.0) 'Size(GB)', typeFROM logical_drives;