Why do weekly tasks created via PowerShell using a different user fail with error 0x41306 Why do weekly tasks created via PowerShell using a different user fail with error 0x41306 powershell powershell

Why do weekly tasks created via PowerShell using a different user fail with error 0x41306


I had a similar problem when creating scheduled task but I don't remember if it was based on the day schedule. I found changing over to gMSA account to run our scheduled task? Which allowed us to set the task to run whether the user was logged on or not. Otherwise you must provide username and password and cannot have the option of user logged on or not.


The default job options might provide a clue. There are many default values that can prevent a job from running. Some of these might be specific to your environment. More info here: http://technet.microsoft.com/en-us/library/hh849674.aspx

If this isn't it, please let me know. I'd like to follow this topic and get this scenario into that troubleshooting guide.

Thanks,June Blender (juneb)Senior Programming Writer, Microsoft


i finally found the solution to this behaviour. I scheduled a task to be executed every sunday to run a powershell script. The script on its own ran fine. Then I tried to start it manually in task scheduler. This ended in error 41306. After reading your comments here I changed the schedule not to first run the next sunday but to start on the last sunday (so the start date is in the past). After that I could immediately start it without any problem.