WMI Associators of DiskDrive Where Result Class is MSStorageDriver

Go To StackoverFlow.com


Trying to link DiskDrives found in Win32_DiskDrive with the data in MSStorageDriver_ATAPISmartData.

I've tried the following WQL statement, but it returned nothing each time. (I know that there is relevant data in the MSStorageDrive class)

ASSOCIATORS OF {Win32_DiskDrive.DeviceID=[value]} WHERE RESULTCLASS = MSStorageDriver_ATAPISmartData

Any ideas to match the data up?

2012-04-04 00:21
by CJxD


The answer was this:

SELECT * FROM MSStorageDriver_ATAPISmartData WHERE InstanceName='[PNPDeviceID]'

Just make sure to double-escape any backslashses. So if the PNPDeviceID as found in Win32_DiskDrive was


what would be returned by getting the value will be


but what you need to send in the WHERE clause is


Silly, isn't it?

Oh, and from what I've gathered, you also need _0 on the end of the Device ID, so all together, you would send:

SELECT * FROM MSStorageDriver_ATAPISmartData WHERE InstanceName='IDE\\\\DISKHITACHI_HDT725050VLA360_________________V56OA7EA\\\\5&276E2DE5&0&1.0.0_0'

2012-04-08 19:59
by CJxD