Jan Nielsen
asked on
Error when running PowerShell script in Task Scheduler
Hi
When I run a Power Shell script in a Task Scheduler I get an error
"The PS1 file is dot digitally signed"
I have tried to use the command "-ExecutionPolicy Bypass" before the path to the PS1 file, in the action--> add arguments section.
Have also tried "-Scope Process -ExecutionPolicy Bypass" but still not working
does anybody have an idea to solve this problem?
/Jan Nielsen
When I run a Power Shell script in a Task Scheduler I get an error
"The PS1 file is dot digitally signed"
I have tried to use the command "-ExecutionPolicy Bypass" before the path to the PS1 file, in the action--> add arguments section.
Have also tried "-Scope Process -ExecutionPolicy Bypass" but still not working
does anybody have an idea to solve this problem?
/Jan Nielsen
Try putting the execution policy in the initial call for the powershell.exe in the task scheduler.
so in the path in task scheduler for your script for example use.
so in the path in task scheduler for your script for example use.
powershell.exe -ExecutionPolicy Bypass -File \\path\to\script.ps1
ASKER
Hi Michael
I have tried it in PS an there it works one time, but if I try using it in the scheduler it does not work, any other ideas?
I have tried it in PS an there it works one time, but if I try using it in the scheduler it does not work, any other ideas?
ASKER
Hi Robert
I
I
I have tried your suggestion too, but with the same result, it does not work
Whats the output of
Get-ExecutionPolicy -List
When run from an elevated PowerShell.
Get-ExecutionPolicy -List
When run from an elevated PowerShell.
ASKER
Is the PowerShell script located on a remote share?
If its local it should just run without being signed.
Which user is trying to start the scheduled task? Local System?
If its local it should just run without being signed.
Which user is trying to start the scheduled task? Local System?
ASKER
Hi Michael
I have tried both local and remote share, but with same result, also I have tried with Local System, Local Administrator, Domanin administrator, but with same result
I have tried both local and remote share, but with same result, also I have tried with Local System, Local Administrator, Domanin administrator, but with same result
And you always get an error regarding an unsigned PS script? Thats weird.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Check the value of HKLM\SOFTWARE\Policies\Mic
Open in new window
If its not set by a GPO, try
Open in new window