PowerShell: Get Disk Serial Number
Need to identify a physical disk by its serial number - for asset tracking, warranty lookups, or confirming which drive is which in a multi-disk system? This one-liner pulls the serial number straight from the hardware.
Prerequisites:
- Privileges: None
- Module: Built-in, no import needed
Quick Command:
Get-CimInstance -ClassName Win32_DiskDrive | Select-Object Name, SerialNumber
Example Output:
Name SerialNumber
---- ------------
\\.\PHYSICALDRIVE0 PFVRR40FJAOFQNMZ3RQ5KCQ
📦
Want all of them at once?
Get every free one-liner from this blog in a single downloadable bundle organized by category, each with full comment-based help. No more copy-pasting one at a time.
Get every free one-liner from this blog in a single downloadable bundle organized by category, each with full comment-based help. No more copy-pasting one at a time.
How It Works:
- Get-CimInstance -ClassName Win32_DiskDrive queries the physical disk drive class - this is different from Win32_LogicalDisk, which reports on drive letters (C:, D:, etc.) rather than the actual physical hardware.
- Name shows the physical device path (e.g. \\.\PHYSICALDRIVE0), which is useful for telling drives apart when a machine has more than one physical disk.
- SerialNumber returns the manufacturer's serial number burned into the drive - useful for asset tracking, RMA/warranty lookups, or confirming exactly which physical unit you're looking at.