PowerShell: List Connected USB Devices

Identifying currently connected USB devices is a fundamental task for system inventory and hardware troubleshooting. This command allows you to quickly filter and verify your active peripheral landscape directly from the terminal.

Prerequisites:

  • Privileges: None
  • Module: Built-in, no import needed

Quick Command:

Get-CimInstance Win32_PnPEntity | Where-Object { $_.DeviceID -like "USB*" -and $_.Status -eq "OK" } | Select-Object Name, DeviceID

Example Output:

Name                             DeviceID
----                             --------
USB Input Device                 USB\VID_413C&PID_2514&MI_02\6&18AD47B4&0&0002
Intel(R) Wireless Bluetooth(R)   USB\VID_8087&PID_0033\5&32E38E0B&0&14
USB Input Device                 USB\VID_046D&PID_C548&MI_02\6&209A32CF&0&0002
USB Composite Device             USB\VID_046D&PID_C548\5&32E38E0B&0&3
USB  SanDisk 3.2Gen1 USB Device USBSTOR\DISK&VEN__USB&PROD__SANDISK_3.2GEN1&REV_1.00\040171A7611C9F0D7CA9966BE3980C29B0EE0D290E083E30...
USB Input Device                 USB\VID_413C&PID_2514&MI_00\6&18AD47B4&0&0000
USB Mass Storage Device          USB\VID_0781&PID_55A3\040171A7611C9F0D7CA9966BE3980C29B0EE0D290E083E30DC55C1A2E2784AE1E57500000000000...
Logitech USB Input Device        USB\VID_046D&PID_C548&MI_00\6&209A32CF&0&0000
USB Root Hub                     USB\ROOT_HUB30\4&24461B21&0&0
USB Input Device                 USB\VID_413C&PID_2514&MI_01\6&18AD47B4&0&0001
USB Composite Device             USB\VID_413C&PID_2514\5&32E38E0B&0&4
USB Input Device                 USB\VID_046D&PID_C548&MI_01\6&209A32CF&0&0001
📦
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.

How It Works:

  • Get-CimInstance Win32_PnPEntity queries the PnP (Plug and Play) entity class, which contains information about all devices currently known to the system, including those connected via USB.
  • Where-Object filters for DeviceID starting with "USB" and Status equal to "OK", so the output only contains active hardware - effectively filtering out disconnected drivers or "ghost" devices left over in the system.
  • Select-Object trims the output down to Name and DeviceID, since Win32_PnPEntity also returns a lot more data (like Manufacturer, Service, or HardwareID) that isn't needed for a quick USB check.

Why Is the List So Long?

Don't worry, your system isn't glitching. Windows manages USB devices as Composite Devices, meaning a single physical piece of hardware (like a headset or keyboard) is often split into multiple logical interfaces - one for audio, one for HID, one for firmware, etc. Each of these appears as a separate line in the system report, even though they all belong to the same physical device.

Pro Tip:

If you want to identify a specific physical device for asset tracking, don't rely on the Name property, as it can be ambiguous or localized depending on the OS language. Use DeviceID instead - it contains the Vendor ID (VID) and Product ID (PID), which are universal hardware identifiers that never change, no matter what language your operating system is set to.