Friday, April 1, 2016

SCCM - Free Space in C Drive SQL-Query

Sometimes it can happen - you getting out of disk space in your C: drive, so usually i run this query to know, if the collection ID i'm patching or deploying something, is enough.

 SELECT   
     SYS.Name,  
     LDISK.DeviceID0,  
     LDISK.VolumeName0,  
     LDISK.FreeSpace0/1024 as [Free space (GB)],  
     LDISK.Size0/1024 as [Total space (GB)]  
 FROM v_FullCollectionMembership SYS  
      JOIN v_GS_LOGICAL_DISK LDISK on SYS.ResourceID = LDISK.ResourceID  
      JOIN v_R_System RSYS ON SYS.ResourceID = RSYS.ResourceID  
 WHERE  
     LDISK.DeviceID0 = 'C:'  
     AND LDISK.DriveType0 = 3  
     AND LDISK.Size0 > 0  
     AND SYS.CollectionID = 'COLLECTION_ID_HERE'  
 ORDER BY SYS.Name, LDISK.DeviceID0  

Enjoy :)

1 comment:

  1. (Yet, Another Blog About ...) System Center: Sccm - Space In C Drive Sql-Query >>>>> Download Now

    >>>>> Download Full

    (Yet, Another Blog About ...) System Center: Sccm - Space In C Drive Sql-Query >>>>> Download LINK

    >>>>> Download Now

    (Yet, Another Blog About ...) System Center: Sccm - Space In C Drive Sql-Query >>>>> Download Full

    >>>>> Download LINK

    ReplyDelete