How do I find the Serial Number of a USB Drive?

Use the freeware USBDeview:

USBDeview is a small utility that lists all USB devices that currently connected to your computer, as well as all USB devices that you previously used. For each USB device, exteneded information is displayed: Device name/description, device type, serial number (for mass storage devices), the date/time that device was added, VendorID, ProductID, and more... USBDeview also allows you to uninstall USB devices that you previously used, and disconnect USB devices that are currently connected to your computer. You can also use USBDeview on a remote computer, as long as you login to that computer with admin user.

alt text


On Linux, usbview will do this, just click on the device in the left pane.


Get USB Serial Numbers on Windows with PowerShell

Here's a PowerShell solution that will give you the serial number of all "USB Mass Storage Devices" mounted on the system which you run it. It uses Get-CIMInstance to query the Win32_PnPSignedDriver class to get the property values with filtering, looping, setting a couple variables, using a method, etc.

Within the PowerShell script below, I left some commented out logic and comments for running with the legacy Get-WMIObject cmdlet for systems with versions below PowerShell 3.0.

PowerShell

$DevId = (((Get-CimInstance -Class win32_PnPSignedDriver) | ?{($_.Description -like '*mass*')}).DeviceID);
$DevSerial = @($DevId | %{$_.Split('\')[2]});
$DevSerial

##### // Everything below is commented out with comments for each section \\ #####

## -- See everything or the selected properties per above
#((Get-CimInstance -Class win32_PnPSignedDriver) | ?{($_.Description -like '*mass*')}) | 
#Select Description, DeviceClass, DeviceID, Manufacturer

## -- Correlated legacy PS code older than PowerShell version 3
#$DevId = ((Get-WmiObject Win32_USBControllerDevice | %{[wmi]($_.Dependent)} | ?{($_.Description -like '*mass*')}).DeviceID);
#$DevSerial = @($DevId | %{$_.Split('\')[2]});
#$DevSerial

## -- See everything or selected properties per above legacy PS code
#Get-WmiObject Win32_USBControllerDevice | %{[wmi]($_.Dependent)} | ?{($_.Description -like '*mass*')} | 
#Select Description, DeviceID, Manufacturer, Service

Supporting Resources

  • Get-CIMInstance
  • Win32_PnPSignedDriver class
  • ForEach-Object

    Standard Aliases for Foreach-Object: the '%' symbol, ForEach

  • Where-Object

    The '?' symbol and Where are both aliases for Where-Object. If you explicitly want to run the Where-Object command, run Where-object or '?'

  • Comparison Operators
  • Split()
  • PowerShell one liner to get USB Flash Drive Serial Number
  • Get Information from Windows device manager

Under Windows 7.1 Right Click 'Computer' -> 'Manage' -> 'Device Manager' -> Navigate to your USB Drive, Right Click -> Properties -> Details, Property->Parent

Value:

USB\VID_1058&PID_0830\575833314133343231313937

The USB unique id is all the characters after the last \, in this case 575833314133343231313937

You can also be able to extract it from Property->Device Instance Path, however that includes some other fields after the USB unique id part, so is slightly harder to read off.