/build/static/layout/Breadcrumb_cap_w.png

KACE Product Support Question


Powershell Script will not run in KACE no matter what method I use!

08/20/2015 4877 views
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

bJJEF9.png

And the logs say it completed

PQlZYD.png
However, I log into the server and the registry keys have not changed. What am I missing?

Thanks
1 Comment   [ + ] Show comment

Comments

  • I agree you may have 3 things happening:

    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"

All Answers

0
Have you tried using the parameter "-executionpolicy unrestricted"?  Some environments restrict powershell scripts.

Also, by default, kscripts run as localsystem.  If the change needs administrator, you would need to use the "run as" feature.
Answered 08/28/2015 by: jknox
Red Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ