James Posted June 4, 2008 Posted June 4, 2008 Hi, I have been looking for a way to determine the drive type, SATA or IDE and found "MSStorageDriver_ATAPISmartData" only I cannot find how to use it. Does anybody know? James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Kerros Posted June 4, 2008 Posted June 4, 2008 Well This is what I can pull from MSStorageDriver_ATAPISmartData. Honestly I don't know if you can reliably pull IDE or SATA from that data. expandcollapse popup; Generated by Scriptomatic $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $Output="" $Output = $Output & "Computer: " & $strComputer & @CRLF $Output = $Output & "==========================================" & @CRLF $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\WMI") $colItems = $objWMIService.ExecQuery("SELECT * FROM MSStorageDriver_ATAPISmartData", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $Output = $Output & "Active: " & $objItem.Active & @CRLF $Output = $Output & "Checksum: " & $objItem.Checksum & @CRLF $Output = $Output & "ErrorLogCapability: " & $objItem.ErrorLogCapability & @CRLF $Output = $Output & "ExtendedPollTimeInMinutes: " & $objItem.ExtendedPollTimeInMinutes & @CRLF $Output = $Output & "InstanceName: " & $objItem.InstanceName & @CRLF $Output = $Output & "Length: " & $objItem.Length & @CRLF $Output = $Output & "OfflineCollectionStatus: " & $objItem.OfflineCollectionStatus & @CRLF If $objItem.Reserved = "" Then $Output = $Output & "Reserved: " & @CRLF Else $Output = $Output & "Reserved: " & $objItem.Reserved & @CRLF EndIf $Output = $Output & "SelfTestStatus: " & $objItem.SelfTestStatus & @CRLF $Output = $Output & "ShortPollTimeInMinutes: " & $objItem.ShortPollTimeInMinutes & @CRLF $Output = $Output & "SmartCapability: " & $objItem.SmartCapability & @CRLF $Output = $Output & "TotalTime: " & $objItem.TotalTime & @CRLF If $objItem.VendorSpecific = '' Then $Output = $Output & "VendorSpecific: "& @CRLF Else $Output = $Output & "VendorSpecific: " & $objItem.VendorSpecific & @CRLF EndIf $Output = $Output & "VendorSpecific2: " & $objItem.VendorSpecific2 & @CRLF $Output = $Output & "VendorSpecific3: " & $objItem.VendorSpecific3 & @CRLF If $objItem.VendorSpecific4 = '' Then $Output = $Output & "VendorSpecific4: "& @CRLF Else $Output = $Output & "VendorSpecific4: " & $objItem.VendorSpecific4& @CRLF EndIf if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop $Output="" Next Else Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Msft_Providers" ) Endif I know that it's in the Identify Data when it's returned from the drive though. Getting to that data is always the issue though. Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.
James Posted June 4, 2008 Author Posted June 4, 2008 OK, just need to add some outputs so I can test it Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now