SCCM 2012: Diskspace Report sorted by Freespace Percentage

System Center admins often get asked for disk space reports.
Depending on the discovery settings the data can be more current in SCOM or SCCM.
So you need to decide which datasource you use.

I have created a report for System Center Configuration Manager 2012, which lists Total Disk Space (MB), Total Free Space (MB), Total Used Space (MB), Total Free Space Percent and Total Used Space Percent.

It sorts by Total Free Space Percent and colour codes the output with this rule:

< 20 %: red
< 40 %: orange
Rest: green

You can select any device collection.

diskspacereport

The report can be downloaded here.

Advertisements
Post a comment or leave a trackback: Trackback URL.

Comments

  • Lakshman  On September 30, 2014 at 3:23 pm

    Hi,

    Could you please provide me a query used to run this report to create in SCCM 2007

    • opsmgrtipps  On October 3, 2014 at 6:49 pm

      Hi,
      here are the queries.
      Diskspace:
      SELECT CollectionID, v_GS_LOGICAL_DISK.DeviceID0, v_R_System.Netbios_Name0 [System Name], v_GS_COMPUTER_SYSTEM.Model0 as Model,
      SUM (v_GS_LOGICAL_DISK.Size0) AS [Total Disk Space:],
      SUM (v_GS_LOGICAL_DISK.FreeSpace0) AS [Total Free Space:],
      Convert(Decimal(4,2),Round(100.0 * SUM (v_GS_LOGICAL_DISK.FreeSpace0) / SUM (v_GS_LOGICAL_DISK.Size0),2)) AS [Total Free Space Percent:],
      Convert(Decimal(4,2),Round(100.0 * (SUM (v_GS_LOGICAL_DISK.Size0)-SUM (v_GS_LOGICAL_DISK.FreeSpace0))/ SUM (v_GS_LOGICAL_DISK.Size0),2)) AS [Total Used Space Percent:],
      SUM (v_GS_LOGICAL_DISK.Size0)-SUM (v_GS_LOGICAL_DISK.FreeSpace0) AS [Total Used:],
      LastHWScan
      FROM v_R_System
      inner join v_GS_PC_BIOS on v_R_System.ResourceID=v_GS_PC_BIOS.ResourceID
      inner join v_GS_COMPUTER_SYSTEM on v_R_System.ResourceID=v_GS_COMPUTER_SYSTEM.ResourceID
      inner join v_GS_LOGICAL_DISK on v_R_System.ResourceID = v_GS_LOGICAL_DISK.ResourceID
      inner join v_FullCollectionMembership on v_FullCollectionMembership.ResourceID=v_R_System.ResourceID AND v_FullCollectionMembership.CollectionID=@CollectionID
      LEFT JOIN v_GS_WORKSTATION_STATUS HWSCAN on v_R_System.ResourceID = HWSCAN.ResourceID
      where v_GS_COMPUTER_SYSTEM.Model0 like ‘%’ and v_GS_LOGICAL_DISK.DeviceID0 like ‘%’ AND v_GS_LOGICAL_DISK.Size0 IS NOT NULL
      GROUP BY
      CollectionID, v_R_System.Netbios_Name0, v_GS_COMPUTER_SYSTEM.Model0, v_GS_LOGICAL_DISK.DeviceID0, LastHWScan
      ORDER by [Total Free Space Percent:]

      Collection:
      SELECT v_Collection.Name ,v_Collection.CollectionID
      FROM v_Collection
      Order By v_Collection
      Kind Regards,
      Natascia

  • Morten  On November 13, 2014 at 12:00 pm

    Hi, thanks for sharing this – When viewing the report in SCCM2012 only the Total disk space column gets data, the others are blank. Am I missing some presetup to collect data?

    • Morten  On November 14, 2014 at 8:59 am

      Sorry – seems that some clients are sending data and others (most) does not – Lenovo T-series.
      Tried to trigger the Hardware inventory on clients but no additional data is received.
      Any ideas?
      Best Regards
      Morten

      • opsmgrtipps  On December 2, 2014 at 11:49 am

        Morten,

        have you checked what is shown in the Resource Explorer for these devices? The Free Space (MB) should be shown there. The client will have a problem with the hardware inventory if nothing is listed there.

        Regards,

        Natascia

  • Morten  On December 3, 2014 at 6:35 am

    Hi Natascia
    Thanks for your reply. For some reason Lenovo X61 does not give data for the HD but all others (400 PC’s) are now updated. Extremely useful – thanks again
    Morten

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: