{"id":6853,"date":"2020-02-19T23:48:27","date_gmt":"2020-02-19T22:48:27","guid":{"rendered":"https:\/\/michlstechblog.info\/blog\/?p=6853"},"modified":"2022-01-20T21:14:30","modified_gmt":"2022-01-20T20:14:30","slug":"windows-get-disk-smartparameter-and-health-status","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/windows-get-disk-smartparameter-and-health-status\/","title":{"rendered":"Windows: Get Disk Smartparameter and Health status"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_6853 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_6853')){$('.twoclick_social_bookmarks_post_6853').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"Windows%3A%20Get%20Disk%20Smartparameter%20and%20Health%20status\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Ain%20newer%20Versions%20of%20the%20Windows%20operating%20system%20you%20to%20not%20need%20additional%20tools%20to%20get%20the%20most%20important%20Harddisk%20smart%20parameters.%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/windows-get-disk-smartparameter-and-health-status\\\/\",\"post_id\":6853,\"post_title_referrer_track\":\"Windows%3A+Get+Disk+Smartparameter+and+Health+status\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>in newer Versions of the Windows operating system you to not need additional tools to get the most important Harddisk smart parameters.<br \/>\n<!--more--><br \/>\nAn overall state of the disks gets the following query. For all supported drives an Property PredictFailure is added.<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\n$aDisks=Get-WmiObject -namespace root\\cimv2 -class Win32_DiskDrive\r\n$aDisks | % {\r\n   $oFailurePredictStatusDisk=Get-WmiObject -Namespace &quot;root\\wmi&quot; -query (&quot;select * from MSStorageDriver_FailurePredictStatus where InstanceName like'&quot;+$_.PNPDeviceID.Replace(&quot;\\&quot;,&quot;\\\\&quot;)+&quot;%'&quot;)\r\n   if($oFailurePredictStatusDisk)\r\n   {\r\n       Add-Member -memberType NoteProperty -InputObject ($_) -Name PredictFailure -Value $oFailurePredictStatusDisk.PredictFailure\r\n   }\r\n}\r\nPS C:\\&gt; $aDisks|ft -AutoSize Model,DeviceID,PredictFailure\r\n\r\nModel                     DeviceID           PredictFailure\r\n-----                     --------           --------------\r\nSamsung SSD 860 EVO 250GB \\\\.\\PHYSICALDRIVE1          False\r\nSanDisk Ultra USB Device  \\\\.\\PHYSICALDRIVE2\r\nSATA SSD                  \\\\.\\PHYSICALDRIVE0          False\r\n<\/pre>\n<p>And with some more details<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\n$aAddProperty=@(&quot;ReadErrorsCorrected&quot;,&quot;ReadErrorsTotal&quot;,&quot;Temperature&quot;,&quot;PowerOnHours&quot;,&quot;ReadLatencyMax&quot;,&quot;WriteLatencyMax&quot;,&quot;Wear&quot;)\r\n$aDisks=Get-WmiObject -namespace root\\cimv2 -class Win32_DiskDrive\r\n$aDisks | % {\r\n   $oFailurePredictStatusDisk=Get-WmiObject -Namespace &quot;root\\wmi&quot; -query (&quot;select * from MSStorageDriver_FailurePredictStatus where InstanceName like'&quot;+$_.PNPDeviceID.Replace(&quot;\\&quot;  ,&quot;\\\\&quot;)+&quot;%'&quot;)\r\n   if($oFailurePredictStatusDisk)\r\n   {\r\n       Add-Member -memberType NoteProperty -InputObject ($_) -Name PredictFailure -Value $oFailurePredictStatusDisk.PredictFailure\r\n   }\r\n   $oStorageReliability=Get-PhysicalDisk -DeviceNumber $_.Index|Get-StorageReliabilityCounter\r\n   foreach($sProperty in $aAddProperty)\r\n   {\r\n       Add-Member -memberType NoteProperty -InputObject ($_) -Name $sProperty -Value $oStorageReliability.$sProperty\r\n   }\r\n}\r\nPS C:\\&gt; $aDisks|ft -AutoSize Model,DeviceID,PredictFailure,ReadErrorsTotal,ReadErrorsCorrected,PowerOnHours\r\n\r\nModel                     DeviceID           PredictFailure ReadErrorsTotal ReadErrorsCorrected PowerOnHours\r\n-----                     --------           -------------- --------------- ------------------- ------------\r\nSamsung SSD 860 EVO 250GB \\\\.\\PHYSICALDRIVE1          False               0                   0          303\r\nSanDisk Ultra USB Device  \\\\.\\PHYSICALDRIVE2\r\nSATA SSD                  \\\\.\\PHYSICALDRIVE0          False                                              409\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Hi, in newer Versions of the Windows operating system you to not need additional tools to get the most important Harddisk smart parameters.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[344,2,4],"tags":[199,1410,133,1409,1411,20],"class_list":["post-6853","post","type-post","status-publish","format-standard","hentry","category-powershell-scripting","category-windows","category-windowsscripts","tag-disk","tag-health","tag-powershell","tag-smart-parameter","tag-status","tag-windows-2"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/6853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=6853"}],"version-history":[{"count":5,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/6853\/revisions"}],"predecessor-version":[{"id":8337,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/6853\/revisions\/8337"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=6853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=6853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=6853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}