$hubs = Get-WmiObject Win32_USBHub $hubs = Get-WmiObject Win32_USBHub Welcome!<\/p>\n You did not really ask a question? Where are you stuck?<\/p>\n If you post code, please use the ‘Insert Code’ button. Please and thank you!<\/p>
\n$powerMgmt = Get-WmiObject MSPower_DeviceEnable -Namespace root\\wmi
\nforeach ($p in $powerMgmt)
\n{
\n$IN = $p.InstanceName.ToUpper()
\nforeach ($h in $hubs)
\n{
\n$PNPDI = $h.PNPDeviceID
\nif ($IN -like “$PNPDI<\/em>”)
\n{
\n$p.enable = $False
\n$p.psbase.put()
\n}
\n}
\n}<\/p>","upvoteCount":5,"answerCount":2,"datePublished":"2019-02-14T22:36:53.000Z","author":{"@type":"Person","name":"warrencobb","url":"https://community.spiceworks.com/u/warrencobb"},"suggestedAnswer":[{"@type":"Answer","text":"<\/a>Disable the advanced power saving mode on all USB Hubs<\/h1>\n
<\/a>Device Manager, Universal Serial Bus controllers, Select USB Root Hub, Properties, Power Management, deselect “Allow the computer to turn off this device to save power”<\/h1>\n
\n$powerMgmt = Get-WmiObject MSPower_DeviceEnable -Namespace root\\wmi
\nforeach ($p in $powerMgmt)
\n{
\n$IN = $p.InstanceName.ToUpper()
\nforeach ($h in $hubs)
\n{
\n$PNPDI = $h.PNPDeviceID
\nif ($IN -like “$PNPDI<\/em>”)
\n{
\n$p.enable = $False
\n$p.psbase.put()
\n}
\n}
\n}<\/p>","upvoteCount":5,"datePublished":"2019-02-14T22:36:53.000Z","url":"https://community.spiceworks.com/t/disable-the-advanced-power-saving-mode-on-all-usb-hubs/697758/1","author":{"@type":"Person","name":"warrencobb","url":"https://community.spiceworks.com/u/warrencobb"}},{"@type":"Answer","text":"