cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 7

Monitor C: drive size.

I am trying to use wmi tool to monitor drives in our file server.  I started out trying to test our file server. 

 

I tried use the Mount Point Free Space Monitor but maybe that is incorrect.   Here is what I have.

 

SELECT PercentFreeSpace FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk WHERE Name='C:\\'

 

SELECT FreeMegabytes FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk WHERE Name='C:\\t'

0 Kudos
2 Replies
Level 7

The correct form of the SELECT statement here is:

SELECT PercentFreeSpace FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk WHERE Name='C:'


It can be discovered by noticing the Name property with this Powershell command:


Get-WmiObject -Query "SELECT * FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk"

0 Kudos
Level 7

Your request should look more like

SELECT FreeSpace FROM Win32_LogicalDisk WHERE   DeviceID="C:"

 

You don't need the extra slashes at the end

0 Kudos