ejuliorod Posted March 17, 2015 Report post Posted March 17, 2015 I have a PS script that I run with an admin account that does not run during the task sequence. The log file shows access denied. I am using a command line because the Run Powershell task does not let me specify an account to use. (I get access denied with that one also) This is my command line - powershell.exe -file myscript.ps1 set-executionpolicy bypass This script runs just fine if I run it via TS when Windows is up and running, it just does not work during the TS when Windows is in provisioning mode. Any ideas? Thanks Quote Share this post Link to post Share on other sites More sharing options...
Ath3na Posted March 17, 2015 Report post Posted March 17, 2015 Just a shot in the dark, does it make any difference if you specify the full path to the powershell.exe C:\Windows\System32\WindowsPowerShell\v1.0 Quote Share this post Link to post Share on other sites More sharing options...
Peter van der Woude Posted March 17, 2015 Report post Posted March 17, 2015 What does the script do and a what time in the task sequence are you using it? Quote Share this post Link to post Share on other sites More sharing options...
ejuliorod Posted March 17, 2015 Report post Posted March 17, 2015 What does the script do and a what time in the task sequence are you using it? We are using "Install Applications according to a dynamic variable list" to install our apps. This PS script is used at the end of the task sequence to clean out the variables placed in the computer Properties Variables tab. It works fine when running within Windows but cannot get it to run via task sequence when Windows is still in provisioning mode. I am running a command line in the task sequence running with an admin account This is the error in the log: File C:\_SMSTaskSequence\Packages\SA100154\RemoveOSDVariables.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170. + CategoryInfo : SecurityError: ( [], ParentContainsErrorRecord Exception + FullyQualifiedErrorId : UnauthorizedAccess I use the same account in the task sequence to launch VB scripts. Thanks for your help Quote Share this post Link to post Share on other sites More sharing options...
Peter van der Woude Posted March 18, 2015 Report post Posted March 18, 2015 I would do something like that via a Status Filter Rule. That saves a lot of problems with permissions and task sequences. Quote Share this post Link to post Share on other sites More sharing options...
ejuliorod Posted March 19, 2015 Report post Posted March 19, 2015 I would do something like that via a Status Filter Rule. That saves a lot of problems with permissions and task sequences. Thanks I will give that a try.. Quote Share this post Link to post Share on other sites More sharing options...
ejuliorod Posted March 19, 2015 Report post Posted March 19, 2015 Just a shot in the dark, does it make any difference if you specify the full path to the powershell.exe C:\Windows\System32\WindowsPowerShell\v1.0 Did try this but same results, thanks for your input Quote Share this post Link to post Share on other sites More sharing options...