scheduled task wont run batch file even with "Log on as a batch job"

Anthony Edwards 21 Reputation points
2021-03-05T16:44:17.58+00:00

Hello,

I am a bit unsure why this stopped working but we have a DC (2016) that runs a daily bat file for reporting, it randomly stopped working.

We had this account defined in the Default domain controller policy for "Allow log on as a batch job" and the account was not listed in "Deny log on as a batch job" under this policy.

This task does not run (set to run even when user is not logged in) and when we edit the task to reverify the creds it comes up with the following;
This task requires that the user account specified has log on as batch job rights....

We undefined the settings in the default domain controller policy and it is also not specified in the default server policy, we ran gpupdate/restarted, and then in local policy on the machine iteself ( we could amend the setting and added the user, also checking the deny. The blasted task still comes up as the same error.

In task history we get "Task Scheduler failed to start "\Daily Reports" task for user "USERACCOUNT123". Additional Data: Error Value: 2147943785."

We can run the script manually and it works, I am at a loss?!
would appreciate some help and thanks in advance!

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,089 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,620 questions
0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. Anthony Edwards 21 Reputation points
    2021-03-05T16:50:29.1+00:00

    also to note when I run RSOP /R it errors (Details None) and also GPRESULT /R says access denied. obviously not very helpful.

    gpresult /r /scope USER -this works okay
    gpresult /r /scope COMPUTER -access denied

    These are run in elevated cmd prompt. I am also logged in as domain admin...

    0 comments No comments

  2. Fan Fan 15,321 Reputation points Microsoft Vendor
    2021-03-08T01:54:37.55+00:00

    Hi,
    Would you please tell how did you configure the schedule task?
    Is is a user configuration, right?
    What if you configure the task run as system?
    Will the same error display again?
    75194-383.jpg

    Best Regards,

    0 comments No comments

  3. Anthony Edwards 21 Reputation points
    2021-03-09T09:06:54.737+00:00

    The task running under system is running indefinitely assume because it hasn't got rights to complete the action I guess.


  4. Anthony Edwards 21 Reputation points
    2021-03-10T08:31:09.713+00:00

    Appreciate your help. we tried multiple restarts.

    gpresult /h report.html
    access denied! with domain admin and elevated CMD.

    0 comments No comments

  5. Anthony Edwards 21 Reputation points
    2021-03-10T08:52:13.177+00:00

    in fairness, I believe this issue preexisted the scheduled report issue.