I was attempting to get disk info of remote machines, including whether or not SMART is enabled on the drive by using the win32_diskdrive class.
This is trickier than I thought. While it's easy enough the read the status property I discovered something interesting in the Capabilities property- namely the value denoting if "SMART Notification" is available. This value will not appear unless the command is run in an elevated security context. So for example if I run (gwmi win32_diskdrive).Capabilities the SMART value (10) does not appear in the array of values yet if I run it in an elevated prompt it does appear. As far as I know you can't run a winrm session in an elevated context (and I'm not interested in cheesy schtasks hacks or psexec).
So then I attempted to map win32_diskdrive to the MSStorageDriver_FailurePredictStatus class. I think I would have to do this anyway because even if SMART appears in the Capabilities property that doesn't necessarily mean its enabled right?
I was mapping the PNPDeviceID property of win32_diskdrive to the InstanceName property of MSStorageDriver_FailurePredictStatus, but now my problem is that I do not think the InstanceName property is unique enough for this to work. For example here is my InstanceName:
It shows the interface type (IDE) the model number (ST3250312AS) the firmware version (JC47) what I thought was a unique identifier of some kind (
5&350bf0c3&0&0.0.0) then what looks like an index number (_0). When I google
5&350bf0c3&0&0.0.0 it turns up some info on the drive so I don't think this number is unique. That means the the uniqueness is in the index number which is not included in the PNPDeviceID property of the win32_diskdrive class. This is an issue because many of our servers have multiple, identical, disks.
My concern is that
MSStorageDriver_FailurePredictStatus would represent multiple disks like this:
IDE\DiskST3250312AS_____________________________JC47____\5&350bf0c3&0&0.0.0_0 IDE\DiskST3250312AS_____________________________JC47____\5&350bf0c3&0&0.0.0_1 IDE\DiskST3250312AS_____________________________JC47____\5&350bf0c3&0&0.0.0_2
And the PNPDeviceID property of win32_diskdrive of all of them would just be
How can I reliably map objects retrieved from win32_diskdrive to
MSStorageDriver_FailurePredictStatus or do this another way with powershell via remote sessions?
Well it looks like I was over-reacting. When I checked a bunch of servers I found InstanceNames\PNPDeviceIDs like this:
If no one can conclusively confirm this, in a day or so, I will just assume this value actually is unique and mark this as the "answer".