4 WMI Queries for Retrieving Disk Information

Looking to optimize your Windows disk? Check out our latest blog post featuring 4 powerful WMI queries for retrieving important information about your disk.

When you want to check free disk space on your Windows machine, you open This PC: and look for the partition or the disk. So, why would you use WMI?

It is about remote monitoring. Checking this space on a single Windows machine is not a big deal. But, imagine you need to check it with hundreds of Windows machines distributed in different locations.

What is WMI?

WMI stands for Windows Management Instrumentation, and it is used to monitor and manage Windows machines. It is available since Windows 2000.

This article shows you 4 different WMI queries you can use to get a healthy state of your disk.

WMI queries

Get information about all disks on the system:

Get-WmiObject -Class Win32_LogicalDisk
Get information about all disks on the system

Get information about a specific disk

Get-WmiObject -Class Win32_LogicalDisk | Where-Object {$_.DeviceID -eq "C:"}
Get information about a specific disk

Get the size and free space of all disks on the system

Get-WmiObject -Class Win32_LogicalDisk | Select-Object DeviceID, Size, FreeSpace
Get the size and free space of all disks on the system

Get information about all partitions on all disks:

Get-WmiObject -Class Win32_DiskPartition
Get information about all partitions on all disks

Does this sound complicated?

As you probably know, I advocate for using Paessler PRTG in any company size. Paessler AG PRTG provides you with preloaded sensors (logical, not physical), that can retrieve even more information about a disk on a Windows system.

You dont need to memorize WMI queries or Google it.

Here are logical sensors that give you more than you would expect:
• WMI Disk Health
• WMI Free Disk Space (Multi Disk)
• WMI HDD Health
• WMI Logical Disk I/O
• WMI Vital System Data v2
• WMI Volume

WMI Free Disk Space (Multi Disk)

🤙 DM me if you want to try it.
🚀 Follow me for more tips.

Comments (2):

  1. Florian

    March 23, 2023 at 09:16

    Thank you 🙂

    The WMI query for “Get the size and free space of all disks on the system” & “Get the file system type of all disks on the system” are the same in your article. Is that your intent? 🙂

    Reply
    • Jasmin Kahriman

      March 28, 2023 at 21:38

      Hey Florian – thanks for pointing to the mistake. Corrected. Thanks for stopping by.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Share via
Copy link