Scheduled Tasks Fail to Run

9

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!

security
scheduled-tasks
windows-server-2003
asked on Stack Overflow Jan 18, 2013 by ssokol91

2 Answers

12

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.

answered on Stack Overflow Jan 20, 2013 by (unknown user)
3

If it's helpful to anyone else, I had to set the GPO to enforced for my purposes.

answered on Stack Overflow Oct 16, 2014 by K LeRoq

User contributions licensed under CC BY-SA 3.0