Scenario: You just created a scheduled task that needs to be run even when nobody is logged on. You have a service account to mange the job and it will run with the highest privileges. Unfortunately, you run the task and nothing happens when the task is triggered.
Solution: This could be the result of many things, but there’s a good chance the service account you chose doesn’t have “Log on as Batch Job” rights in the local security policy of the server. Here’s how to enable that:
- Go to the Start menu
- Type secpol.msc and press Enter
- The Local Security Policy manager opens
- Go to Security Settings – Local Policies – User Rights Assignment node
- Double click Log on as a batch job on the right side
- Click Add User or Group…
- Select the user and click OK
If you find this setting grayed out, this means a policy is controlling it. 9 times out of 10 it’s this policy: Default Domain Controllers Policy. You can head to Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment and make the change instead of going through the Local Security Policy.
Save this and try to trigger your task again. There’s a good chance it will work this time, if this is the only issue.
Let me know if this works for you guys or not.