In Windows 2012 (myServer1), I have a scheduled taks (myTask) running as myDomain\user1. I can manually run it any time in addition it runs as scheduled.
After myServer1 was upgraded directly to 2019, myTask still runs successfully as scheduled, but when I run it manually, it failed with error message:
The user account does not have permission to run this task.
I tried the following command to assign permission to user1
$taskPath = ""
$taskName = “myTask”
$principal = New-ScheduledTaskPrincipal -UserId “myDomain\user1” -LogonType ServiceAccount
Set-ScheduledTask -TaskPath $taskPath -TaskName $taskName -Principal $principal
The following command show user1 has READ permission
But when I manually run it, it still failed with same error.