locked
Problem Running Powershell Scripts With Task Sequence RRS feed

  • Question

  • Has anyone been able to use the 'Run Command Line' task sequence task and while specifying  "RUN AS" credentials  and get a PowerShell script to run?

     

    I have been trying to get PowerShell scripts to run from the 'Run Command Line'  task while specifying a "RUN AS" account  for a while now with no success.

     

    Here is the syntax I use in the task sequence step: Powershell.exe -Executionpolicy Bypass -File .\filename.ps1

    Scripts seem to run fine when you don't specify a "RUN AS" account. Why would specifiny an account in the GUI break things? Anyone have thoughts?





    Thursday, June 18, 2015 11:32 AM

Answers

  • I just gave up using "run as" I could not figure it out for the life of me.
    • Marked as answer by Tony Chirillo Thursday, July 30, 2015 6:09 PM
    Thursday, July 30, 2015 6:09 PM

All replies

  • Hi,

    Have you tried the script with PSExec, -l option allows to run process as limited user?

    Does it make any difference if you give the full path of powershell.exe?


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, June 22, 2015 2:58 AM
  • Hi Daniel

    Full path did not make a difference. Have not tried using PSExec. Have you had any success using the Run Command Line step using a PowerShell script with specifying alternate credentials?

    -Tony

    Wednesday, July 15, 2015 9:49 PM
  • I just gave up using "run as" I could not figure it out for the life of me.
    • Marked as answer by Tony Chirillo Thursday, July 30, 2015 6:09 PM
    Thursday, July 30, 2015 6:09 PM