"Access is Denied" (0x80070005) when running scheduled tasks on Windows Server 2019


I just set up a new Windows Server 2019 instance, and am trying to run tasks (C# console apps) through Windows Task Scheduler. I've set it up to log in as a certain windows user, which has "Administrators" permission. However, when I try to run the task (either on a schedule or by logging in and running it on-demand) it gives the error:

"Access is Denied" with the error code 0x80070005. Things I've tried so far:

  • Double-checked that the user account's password is correct.
  • Double-checked that they're in the Administrators group.
  • Tried using a different admin user account.
  • Installed all windows updates.
  • Rebooted the server.
  • Given all permissions to the directory where the job executable resides.
  • Checked the box to run the job with "highest privileges".

Nothing has worked... I'm wondering if others have faced this issue with Windows Server 2019, and how they got scheduled tasks to run?

asked on Stack Overflow Jan 29, 2019 by Justin

1 Answer


In Windows 7 SP1 I encountered with same problem. Nothing worked.
I found workaround:
1) In Task Scheduler export task (to .xml).
2) Delete task in Task Scheduler.
3) Edit .xml-file:
3.1) In second string replace

Task version="1.2"
Task version="1.3"

3.2) Replace string
Or add string
after string
if string
is absent.
4) Import .xml-file to Task Scheduler.
Now task runs.
I found this workaround when I noticed that built-in Windows tasks run normally.

answered on Stack Overflow Aug 22, 2019 by Mish

User contributions licensed under CC BY-SA 3.0