MoonPoint Support Logo

 


Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
October
Sun Mon Tue Wed Thu Fri Sat
       
13
2015
Months
Oct


Tue, Oct 13, 2015 9:35 pm

Obtaining the model number and serial number for a HDD from the command line

If you wish to obtain the model number and serial number for a hard disk drive (HDD) from the command line on a Microsoft Windows system, you can use the Windows Management Instrumentation command line tool wmic at a command prompt or get-wmiobject -class win32_diskdrive from a Windows PowerShell prompt.

For wmic, you can use the following command:

C:\Users\JDoe\Documents>wmic diskdrive get caption, model, serialnumber
Caption                          Model                            SerialNumber

TOSHIBA MQ01ABD075               TOSHIBA MQ01ABD075               73RISBDFS

Seagate Backup+ Desk USB Device  Seagate Backup+ Desk USB Device  NA5J4H3R

In the above example, I also included the caption parameter to get a description for the drive that may help me more easily identify it, though in this case the caption information and the model information are the same. In the above case, the Toshiba drive is the internal drive in the system while the Seagate is an external, USB-attached drive.

To use PowerShell to obtain the same information, I could use the command below:

PS C:\Users\JDoe> get-wmiobject -class win32_diskdrive | format-table Caption, Model, SerialNumber

Caption                                 Model                                   SerialNumber
-------                                 -----                                   ------------
TOSHIBA MQ01ABD075                      TOSHIBA MQ01ABD075                                 73RISBDFS
Seagate Backup+ Desk USB Device         Seagate Backup+ Desk USB Device         NA5J4H3R

You can obtain much more information on drives in PowerShell with the get-wmiobject -class win32_diskdrive | format-list * command. If the drive supports Self-Monitoring, Analysis and Reporting Technology (SMART), you can use the status command to learn if the drive may be failing or is encountering problems that could lead to a drive failue.

PS C:\Users\Jim> get-wmiobject -class win32_diskdrive | format-table Caption, Model, Status, SerialNumber

Caption                       Model                         Status                        SerialNumber
-------                       -----                         ------                        ------------
TOSHIBA MQ01ABD075            TOSHIBA MQ01ABD075            Pred Fail                                73RISBDFS
Seagate Backup+ Desk USB D... Seagate Backup+ Desk USB D... OK                            NA5J4H3R

The Toshiba drive has a status of Pred Fail, which indicates a SMART-enabled hard disk may be functioning correctly, but a failure is predicted soon. You can also retrieve the status of a drive using the wmic command.

C:\Users\JDoe\Documents>wmic diskdrive get model, status, serialnumber
Model                            SerialNumber  Status
TOSHIBA MQ01ABD075               73RISBDFS     Pred Fail
Seagate Backup+ Desk USB Device  NA5J4H3R      OK

Other parameters you can use with wmic to obtain drive information, such as the capacity of the drive, etc., are listed at Using wmic to get disk drive information.

A PowerShell command that can be used to determine which drive the operating system considers to be drive zero, drive one, etc. is shown below:

PS C:\Users\JDoe> Get-WmiObject Win32_PhysicalMedia | Format-Table Tag, SerialNumber

Tag                                                         SerialNumber
---                                                         ------------
\\.\PHYSICALDRIVE0                                                     73RISBDFS
\\.\PHYSICALDRIVE1                                          NA5J4H3R
\\.\CDROM1
\\.\CDROM0

References:

  1. Physical disk status is not OK
    Microsoft Developer Network
  2. Disk Drive Dangers - SMART and WMI
    I Programmer - programming, reviews and projects
  3. Using wmic to get disk drive information
    Date: July 10, 2010
    MoonPoint Support

[/os/windows/commands/wmic] permanent link

Once You Know, You Newegg AliExpress by Alibaba.com

Shop Amazon Local - Subscribe to Deals in Your Neighborhood

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo