disable power managment on usb hubs k1000
Hi, I am trying to disable / remove the check mark on "allow the computer to turn off this device to save power" on all usb hubs. I have a power shell script that works if ran as administrator however when I use it on standard user workstations using the k1000 to run the script with the setting "run as specific user" and set the domain administrator credentials it wont work, it says it ran but it never changes. If I run it as the local logged in user then they do not have rights to modify that setting so I'm stuck. I'm not smart enough to script it but if I had a vb script to do it I belive I could run it as "specific user" and use the domain admin. so really I'm looking for help on this one. scripts, ideas etc. here is the ps that I'm using that works (i coppied it from the internet)if ran in ps as administrator but wont work if running from kbox
any help is very much appreciated could this be converted to a vb script?
$hubs = Get-WmiObject Win32_USBHub
$powerMgmt = Get-WmiObject MSPower_DeviceEnable -Namespace root\wmi
foreach ($p in $powerMgmt)
$IN = $p.InstanceName.ToUpper()
foreach ($h in $hubs)
$PNPDI = $h.PNPDeviceID
if ($IN -like "*$PNPDI*")
$p.enable = $False
Answer Chosen by the Author
i just now got it to work. running it as "local system" did the trick. script ran and disabled power management on all usb root hubs for me.