Scheduled Tasks Fail to Run

ssokol91 picture ssokol91 · Jan 18, 2013 · Viewed 9.7k times · Source

I have a couple of scheduled tasks that run VBS script. It used to be set to "Run as" the person who has left our company. Obviously, after his account was removed, I had to change the tasks to run as another user.

We have an AD account that I setup to use to "run as" for each task. Tested the tasks by running it, scheduling it to run 2-3 minutes from now, and it worked. So, I scheduled the tasks to run everyday at the certain time. The next day the tasks failed with a following error:

The attempt to log on to the account associated with the task failed, therefore, the task did not run.

The specific error is: 0x80070569: Logon failure: the user has not been granted the requested logon type at this computer. Verify that the task's Run-as name and password are valid and try again.

So, I go in and see that "Run As" logon stays the same, so I re-enter the password and test the task again. It runs fine, which tells me that it recognizes the logon and password used in the "Run As" property. The next day it fails again.

Any suggestions, recommendations at what to look at?

Thanks everyone!

Answer

user121356 picture user121356 · Jan 20, 2013

The account your Scheduled Task is running as needs to have the "logon as a batch job" right given to it. Use the Group Policy editor (gpedit.msc) to add that right to the relevant account. Navigate down to Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment, and find Logon as a Batch Job. Then, add the account in question to that policy.