Jump to content
Sign in to follow this  
James

MSStorageDriver_ATAPISmartData

Recommended Posts

Kerros

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.

; 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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.