Powershell Script will not run in KACE no matter what method I use!
Hi guys,
I have been banging my head against a wall all day trying to get a powershell script to run successfully against a remote server using KACE. The powershell script is supposed to change the permissions for some registry keys to be "full control" for the Administrators group. Whenever I run it manually locally on the server it works fine. If I run it using KACE the logs say it completes successfully but then I logon to the server and no changes have been made.
In KACE i am running an Online KScript as a domain admin where "On Success" I "run a batch file" with 2 dependencies and the following command:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command C:\ProgramData\Dell\Kace\kbots_cache\packages\kbots\59\2008RegPermissionsChanges.ps1
And the logs say it completed
However, I log into the server and the registry keys have not changed. What am I missing?
Thanks
1 Comment
[ + ] Show comment
Answers (1)
Please log in to answer
Posted by:
jknox
9 years ago
1.) powershell execution policy ("restricted" by default)
2.) windows redirection (running 32-bit commands in a 64-bit OS, the classic conundrum with KACE agent on x64 OSs)
3.) user rights (by default, powershell is invoked and executed as the user and some actions may require elevated privilege)
What OS? If Windows 7 x64 and running these commands within the 32-bit KACE agent, you'll need to invoke Powershell via SYSNATIVE (note: other suggested parameters shown here):
c:\windows\sysnative\WindowsPowerShell\v1.0\powershell.exe -nologo -executionpolicy bypass -WindowStyle hidden -noprofile -file "scriptname.ps1" - blaise_gregory 9 years ago