If the Execution Policy is Restricted, AllSigned as shown below the task would fail with The task is set to run as Local Administrator.įind the Execution Policy set on the System.
Status of the Task and the output in the Log file. Though the Author of the Script is Domain account.Įnsure 'Run whether user is logged on or not' is checked if your script is specific time dependent and not user logon status.Ĭheck 'Run with highest privileges' - To ensure the script runs elevated.Ĭlick 'OK' and 'Enter the Local Administrator Credentials.' Select 'Open the Properties.' and Click 'Finish'Ĭheck the user name - Here its local Administrator or server RDS1. Ie It should be 'C:\Program Files\My Data\Run Script.ps1' and not 'C:\Program Files\My Data\Run Script.ps1' The filename should be in double quotes even if the path has spaces in the Putting the filename in single quotes here would give a error while executing. Set the Program as 'Powershell.exe' and the Arguments as '-file. Select the option as appropriate for script execution. | Out-File c:\scriptLog.log -Force -Append