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
If these are 64 bit machines it is most likely a sys native problem. The client is 32bit and there is no powershell structure under the syswow64 folder.
<launch_program path="%SystemRoot%\sysnative\WindowsPowerShell\v1.0\" program="powershell.exe" wait="false" parms="-executionpolicy remotesigned -file $(KACE_DEPENDENCY_DIR)\usbhubpower.ps1" />
also see if your registry changes are going to the 64bit registry or the 32bit (WOW6432Node)