Getting USB port name and details

15,769
gwmi Win32_USBControllerDevice |%{[wmi]($_.Dependent)} |select name,description,  deviceID, manufacturer | format-table -group by manufacturer

Some explanation

The WMI class WIN32_USBControllerDevice describes the connection between USB controllers (The Antecedent) and their logical devices [CIM_LOGICALDEVICE] (the Dependent)

PS>gwmi Win32_USBControllerDevice |fl Antecedent,Dependent Antecedent : \\.\root\cimv2:Win32_USBController.DeviceID="PCI\\VEN_8086 &DEV_3A35&SUBSYS_02931028&REV_00\\3&172E68DD&0&E9" Dependent : \\.\root\cimv2:Win32_PnPEntity.DeviceID="USB\\ROOT_HUB\\4& 10B856B0&0"

now you can check win32_PnPEntity to get more info about the device ex:

gwmi Win32_PnPEntity -Filter "DeviceID='USBSTOR\\DISK&..'"
Share:
15,769
Akhil
Author by

Akhil

@khil.online A die-hard android fan, software engineer, interested in technical blogs, gadgets etc.Always present in XDA forums. Love Social Networking. Active(addict) in StackOverflow.

Updated on June 11, 2022

Comments

  • Akhil
    Akhil almost 2 years

    How can I get all USB ports and related details like port name, using Power Shell Script?

    I tried Win32_USBControllerDevice class. But did not get a port name.