Forum Discussion
erickgomes
Jun 25, 2019Copper Contributor
Scheduled Task Windows Server 2019 (EDIT)
Hello guys,
I'm having a problem with the Windows Server 2019 Task Scheduler.
It does not work as in Windows Server 2012.
What do I need to do to make this work?
EDIT:
Guys, what I figured out is that the task scheduler works for 1 simple task, for a given time.
But it does not work to repeat every day, every 5 minutes, indefinitely.
What has changed in Windows Server 2019?
- cook_91Copper Contributori use command to add to task scheduler
SCHTASKS /CREATE /SC MONTHLY /MO second /D SUN /TN "TASKS" /TR "C:\scripts\task.bat" /ST 08:00 /RU SYSTEM
runs every month on the second sun at 8:00am - technologeniusCopper Contributor
erickgomes On S2019, run the task as "Once" or "Weekly" (and select every day). Then, set interval & "Indefinitely." Trigger the task by manually running it once, and it will work from that point on.
- gregp955Copper Contributor
I'm having the same problem with WS 2019. I've found that, at least in my case, I can sometimes fix the scheduling by running the task manually. After it's run manually, the scheduler seems to start working.
- calverley1000Copper Contributor
I have the exact same problem. Task scheduler runs everything at 1/16 speed and all tasks that run that take more then 5 minutes are immediately ended at 5 minutes.
we have tried everything batch file does the same, .exe does the same, powershell does the same.
We have a scheduled task that is due to run every 10 min indefinitely with this issue
also found out that if you disable then re-enable, it never runs again.
- croundCopper Contributor
I'm having the same issues with Server 2019. I'm having no luck finding anything solid. I really hope that Microsoft see this issue.
I have tasks that I have run on 2008 r2, 2012 r2 for years with no issues what so ever. But 2019 has major issues with keeping a schedule. If the server is rebooted and comes up after it's "trigger" time that task will not run, but the GUI shows nothing helpful. The only way I have "fixed" this issue, and I don't really call it a fix, it to reschedule the task. But this is a short term fix.
I have found 1 suggestion to not have a daily trigger, but a one time trigger with an a duration of indefinitely. I hope this fixes it, i'm quite frustrated.
The other issue I have is that I define a domain user when creating the task, but any subsequent edits the domain is removed and will not take the passed. I have to add the domain back in.
These 2 items are giving me major issues with Server 2019 that appear to be introduced with Server 2016 and continue in 2019.
Thanks for listening to my small rant.
- TimRSACopper Contributor
"I have found 1 suggestion to not have a daily trigger, but a one time trigger with an a duration of indefinitely. I hope this fixes it, i'm quite frustrated. "
You have no idea how frustrated I was, until the line. You are a legend. It's working for me now. Thanks a lot!
- LucguardianCopper Contributor
Hierickgomes ,
Did you discovered what is happening? I am observing a strange behavior of Task Scheduler in WS 2019. Sometimes the task stops repeating, sometimes it begins to ignore the time for repeating and tries to repeat the task at very short intervals (like 12 seconds).
Might check here to see what happened.
Event Viewer\Applications\
Microsoft\Windows\TaskScheduler\Operational - DogKnihtCopper Contributor
thx Dave. The Event Viewer showed exactly what the problem was:
Even tho I created the Task as the DOMAIN\Administrator when I selected the "Run only when user is logged in" option I did not notice that the user specified by default was COMPUTER\Administrator!
After changeing that, it worked fine 🙂