USB Device connection Path information RRS feed

  • Question

  • Please help

    i'm using powershell on windows 7 and i want to get the complete device path from an external usb hub's port to an attached USB device. powershell is great in reporting back a ton of information but it does not show which hub/port that a device is attached to. basically id' like to get back the same information that Usb Device Viewer: TreeView returns, that shows a USB device such as a camera attached to External USB Hub, Port 5.  currently, i'm using the following powershell command: 

    powershell -command "& {get-wmiobject -class Win32_USBControllerDevice -computername "LocalHost" -namespace "root\CIMV2" }"

    While the information return back from the above command is great, it does not show what USB Hub and port the devices are connected to.


    Tuesday, July 21, 2020 10:35 PM

All replies

  • 1. Get the hubs then get the hubs ports then get the pots devices.

    2. Get the device and the get its associated port then get the ports associated device.

    Two approaches to the same problem.  Take your pick.


    Tuesday, July 21, 2020 11:13 PM