Hdd ap

Detect HDD or SSD plus SMART Health

Drive type detection and drive health.


This agent procedure detects the type of hard drive the Windows OS is using. Either HDD, SSD, or Virtual. It also gets the health (for HDD and SSD), the SSD Wear and Power on Hours, and any HDD Read Errors.

This script uses PowerShell commands only available to Windows 8 and above including Windows Server 2012 and above. It is important to mention that this script is designed for the C drive but you can edit the script to check other drives. Also, this has not been tested on RAID arrays... Any feedback would be greatly appreciated.

This Agent Procedure requires Custom Fields to be created exactly as they appear in the included Documentation PRIOR to importing the Agent Procedures. Most of the times the Custom Fields will match so you do not have to edit the Agent Procedure. There is a possibility that the import doesn’t detect the Custom Fields and you will have to edit the Agent Procedure.

  • Name: Sidney Sahdala
  • Company: Kaseya
  • Website: http://www.kaseya.com
  • Contact Developer
  • Summary
  • Detect HDD or SSD plus SMART Health
  • Version: 1.0
  • Released on August 19th, 2019
  • Reviews

    Detect HDD or SSD plus SMART Health has no reviews.

    Gravatar for Sidney Sahdala
    Sidney Sahdala about 1 year ago

    This Agent Procedure together with the Windows System Stability Index Agent Procedure (https://automationexchange.kaseya.com/products/619will be very helpful in judging the reliability of a system.

    Gravatar for Dmitrij Kondrasov
    Dmitrij Kondrasov about 1 year ago


    I've got an errors:

    Failed THEN in step 34 (Line 51)

    Failed ELSE in step 2 (Line 60)

    Tried several times.

    Firstly I've created Custom Fields and run procedure. Tried on two computers with SSD disks.

    Gravatar for Kevin Saunders
    Kevin Saunders about 1 year ago

    I am getting the same errors that Dmitrij is getting.

    Gravatar for Dale
    Dale about 1 year ago

    I am also getting the same errors and I have tried on around 15 machines which all have different specs. Not once has it done a successful run.

    Gravatar for Aaron
    Aaron 12 months ago

    Some reports say SSD Wear 0

    ANd some say SSD Wear 100

    What gives?

    Gravatar for Sam James
    Sam James 12 months ago

    Doesn't run for me - all tests show Failed THEN in step 34 (Line 51)

    Gravatar for Sam James
    Sam James 12 months ago

    Fix for: Failed THEN in step 34 (Line 51) and possibly any others go through and ensure all the CF fields are mapped. There shouldn't be any blanks. Just testing on a failing drive

    Gravatar for Dale
    Dale 12 months ago

    It looks like there is a problem with the initial instructions. Number 4 should read SSD Power on Hours (C:) instead of SSD Power no Hours (C:)

    This spelling mistake will not allow for the agent procedure to automatically detect the custom field. You can leave it incorrect but then you have to manually edit the agent procedure and manually select the field.

    Gravatar for Sam James
    Sam James 12 months ago

    And Dri ve Type I've just noticed

    Gravatar for Sam James
    Sam James 12 months ago

    Caught quite a few drives with read errors so far so great when you get it going. Also added in the create ticket when it goes above a threshold. Got one SSD with 100 wear but there is a firmware update (Kingston) that apparently makes wear levels more accurate. 

    Gravatar for John
    John 12 months ago

    I've noticed a few of the SSD drives have reported back "SSD Power on Hours (C:)" as "ÿþ".  Something is off there unless that is expected if it can't pull the data.

    Also, Dale is spot on with the spelling error on the CF in question.  Change it from no to on and it will function as expected.

    Gravatar for M
    M 12 months ago

    I found that if you modify the text output for the powershell commands, the "ÿþ" problem goes away.

    Example From:

    (Get-Disk 0 | Get-StorageReliabilityCounter).PowerOnHours >> vAgentConfiguration.agentTempDir#\PowerOnHours.txt 


    (Get-Disk 0 | Get-StorageReliabilityCounter).PowerOnHours | Out-File -FilePath #vAgentConfiguration.agentTempDir#\PowerOnHours.txt -encoding ASCII

    Gravatar for John
    John 12 months ago

    That seems to have fixed it.  Thanks

    Gravatar for Dale
    Dale 12 months ago

    Thank you, M

    Gravatar for Brian McGarey
    Brian McGarey 10 months ago

    Does anyone have an idea how to correct the unknown drive type?

    Gravatar for Sidney Sahdala
    Sidney Sahdala 5 months ago

    Thanks for everyone's help here. I will be updating this. I have noticed that some drives do not show and am working on this. I am looking for a solution for the unknown drive issue but I think this may be fixed in later versions of PowerShell. I am trying to stick with PowerShell 5 and if I have to use a newer version I will make another submission to the Automation Exchange specifying the version. 

    Gravatar for marcb
    marcb 5 months ago

    Thanks Sidney, I anxiously await your discovery...

    Gravatar for John Halama
    John Halama 27 days ago

    I'm testing with changing all instances of:
    Get-Disk 0 |

    Get-Disk | Where-Object {$_.IsBoot -eq 'True'} |

    Ran into a few systems where disk zero is not C: