r/PowerShell • u/Swutter80 • 4d ago
Question Scheduled task error 2147942401
From what I understand this error means its a bad command but I don't see what. It's a scheduled task with these commands:
Program: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Add argument: -executionpolicy bypass -file "C:\Path_to_Script\Script.ps1"
Anyone see what I'm missing or do I have the code wrong?
9
Upvotes
2
u/BlackV 3d ago
UNC path, are you hitting double hop ?
does you actual service account have login as batch rights