

There are other values that status could be set to, for a more detailed explanation see Win32_DiskDrive class on MSDN. If the status is “Degraded” or “Pred Fail” it’s likely that the drive is going to fail and the drive needs to be replaced. Running any of the above should give you the Caption and Status of the drive. ExecQuery ( "Select * from Win32_DiskDrive" ) For Each Drive in colDrives WScript. Here’s an example using PowerShell: $WMI = Get-WMIObject -Computer REMOTECOMPUTER -Class Win32_DiskDrive ForEach ( $Drive in $WMI )!\\" & strComputer & "\root\cimv2" ) Set colDrives = objWMIService. WMIC /Node:REMOTECOMPUTER DiskDrive GET Caption, Status Grabbing the caption is beneficial for identifying which status belongs to which drive. This example, from Command Prompt using WMIC, will grab the Caption and Status for all drives on the computer. All of the examples are remotely querying the computer using WMI, so it is important that you have security to WMI on the remote computer.

#CHECK HDD SMART STATUS WINDOWS 10 CODE#
So all of the examples below will give you the same answers but I thought I’d share the code for accessing it with a couple different languages. I wasn’t interested in any of the metrics, only whether or not SMART thought the drive was failing. I needed a way to check the SMART status of a drive remotely and was able to come up with a couple different methods to do it. It’s then up to the user to replace the drive before the loss of data. If the number of failures reach a certain threshold the drive can communicate that back to the BIOS or operating system and alert the user that the drive is failing.

Using SMART, the drive will log read/write failures. SMART (Self-Monitoring, Analysis and Reporting Technology) is a technology incorporated into most hard drives that monitors the health the drive.
