Querying for SMART drive-failure data with WMI from .NET?

J

Jesse

Hi,

Sorry for the newb question, but, well, I'm a newb when it comes to WMI.


I'm trying to access SMART disk failure data using WMI from VB.NET on Win XP
SP1. I've
gotten basic disk info with:

Dim oQuery As New System.Management.ObjectQuery("select * from
Win32_DiskDrive")


....but when I try


Dim oQuery As New System.Management.ObjectQuery("Select * From
MSStorageDriver_FailurePredictData")


I get "An unhandled exception of type
'System.Management.ManagementException' occurred in system.management.dll
Additional information: Invalid class"


Can anybody tell me what I'm doing wrong?


Thanks!


Here's the actual code:


Dim oQuery As New System.Management.ObjectQuery("Select * From
MSStorageDriver_FailurePredictData")
Dim oSearcher = New ManagementObjectSearcher(oQuery)
Dim oReturnCollection As ManagementObjectCollection = oSearcher.Get()


Dim oReturn As ManagementObject
For Each oReturn In oReturnCollection
...
Next



--
 
J

Jesse

I wasn't. Now I am, and it works correctly. Thanks!

But I'm only getting data back from my internal drive; my external USB drive
doesn't show up in the queries. Do I need to do something special to get
information back from the external drive?

Also: can you recommend a good reference for me to read that might explain
this stuff at a very basic level? I've found some isolated examples, but
nothing that actually explains the "big picture".

Thanks,

Jesse
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top