finding offline disks using Get-WmiObject

  • hello

    I'm trying to find which disks in my server are offline with the following powershell query....

    Get-WmiObject -Query "SELECT Availability FROM WIN32_volume"

    but it doesnt return a value. anyone know what i'm doing wrong and how to find this info using powershell?

  • Doesn't look like you're doing anything wrong to me. Running

    Get-WmiObject -Class Win32_Volume |fl *

    Shows everything available from that class but Availability is Blank.

    It's also blank for the Win32_LogicalDisk and Win32_DiskDrive classes.

    I know that doesn't answer the question of how to find the information but maybe there's something else in one of those classes that will work for you.

    I'm not sure since I don't have a server with offline disks to check against.

  • thanks for the reply. unfortunately, i cant see anything in the other classes that would help. I did find this blog post which couldve helped....but cant find the follow up blog post.

    http://blogs.technet.com/b/heyscriptingguy/archive/2009/08/05/hey-scripting-guy-can-windows-powershell-call-wmi-methods.aspx

    "One thing you will notice is that not all properties return data. One day, DS, I will show you a really cool way to take care of the missing property value problem (the technique is something I came up with while I was writing the 200 scripts for the Windows 7 Resource Kit), but that is a subject for a future Hey, Scripting Guy! article."

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply