Task Scheduler failed to start – Error Value: 2147943645

I had set up a couple of task scheduler jobs on a server to restart couple of services.
After checking on those jobs the next morning, I saw that both of them failed with error message –

Task Scheduler failed to start “\xyz” task for user “Domain\MyUserName”. Additional Data: Error Value: 2147943645.

I kicked off both jobs manually and they ran fine. After having another look at the setup, it turned out I forgot to set the option to run the jobs even if user account under which the jobs run is not logged in. After changing this setting everything worked fine.

Task Scheduler