KuifJe Posted March 18, 2010 Report post Posted March 18, 2010 Hi there, I have a Windows Server 2008 R2 task sequence running flawlessly. Installing applications and App-V packages, adding to the proper domain and OU. Recently we created a script changing some settings with powershell. To be able to run this script in the tasksequence I'm trying to change the execution policy to 'unrestricted'. We have a policy in place to change the execution policy to 'RemoteSigned' but this policy is applied at the end of the tasksequence. To change the policy I've added a command line entry in the task sequence with the following command: cmd /c Powershell.exe -Command Set-ExecutionPolicy Unrestricted This command works properly when I run it from a CMD prompt, however it has no effect when run during the task sequence. I've browsed through the SMSTS.log file and I see the commandline being built and called with the smsswd.exe tool, it seems to run properly and finish as it should, but after checking the policy setting in Powershell it's still on 'Restricted' Any thoughts or ideas? Quote Share this post Link to post Share on other sites More sharing options...
jmgsanches Posted March 15, 2011 Report post Posted March 15, 2011 Does any one have an update for this case? I'm having the same problem. Quote Share this post Link to post Share on other sites More sharing options...
Joe Posted July 6, 2011 Report post Posted July 6, 2011 Have you tried disabling 64bit redirection on the task? I'm not sure if that is causing your problem, but I always tick that box when I'm trying to make a systemwide change... just to make sure something isn't redirected since ccm is a 32bit process. Quote Share this post Link to post Share on other sites More sharing options...
cornasdf Posted February 8, 2012 Report post Posted February 8, 2012 This is old now but i have had success prepending it in my command line. as in: powershell.exe -noprofile set-executionpolicy remotesigned -force;.\MyScript.ps1; exit $LASTEXITCODE this sets the exec policy, runs the script and returns the LASTEXITCODE to sccm. Quote Share this post Link to post Share on other sites More sharing options...