Check Mount Points and Disk Free Space with PowerShell

Bradley Schacht

Bradley Schacht is a Cloud Solution Architect on the state and local government team with Microsoft based in Jacksonville, FL. He has co-authored 3 SQL Server books including "SQL Server 2014 Professional Administration". As a former consultant and trainer, he uses his experience on many parts of the Microsoft BI and data platform to help customers deliver the best possible solutions. Bradley frequently presents at community events around the country. He is a contributor to sites such as SQLServerCentral.com and an active member of the Jacksonville SQL Server User Group (JSSUG).

You may also like...

5 Responses

  1. Nitin Bidve says:

    Thank you so much …

    I was all worried about how to check free for Mounted drive as this are mounted in folder on d:

    I could check out space for d: [Win32_LogicalDisk] and concerned about mounded drive in folder in D:

  2. avadhut says:

    Thanks for the query,How do I call this in SQL server Query Analyzer ?

  3. Brittany says:

    Thank you! It works!

  4. Maria says:

    Thanks, works great!

  5. a@abc.com says:

    try
    Get-WmiObject Win32_Volume -ComputerName LocalHost `
    | Format-Table Name, `
    @{Name=”Size(MB)”;Expression={“{0:0,0.00}” -f($_.Capacity/1mb)}}, `
    @{Name=”Free Space(MB)”;Expression={“{0:0,0.00}” -f($_.FreeSpace/1mb)}}, `
    @{Name=”Free (%)”;Expression={“{0,6:P0}” -f(($_.FreeSpace/1mb) / ($_.Capacity/1mb))}}, `
    @{Name=”Block Size”;Expression={“{0,6}” -f($_.BlockSize/1kb)+”k”}}, DeviceID –AutoSize

Leave a Reply