Scheduled Task Windows Server 2019 (EDIT)

Copper Contributor

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?

18 Replies

Might check here to see what happened.

Event Viewer\Applications\Microsoft\Windows\TaskScheduler\Operational

 

 

 

Hi@erickgomes ,

 

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).

@erickgomes 

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.

@calverley1000 

 

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.

You can vote up or provide this feedback over here on uservoice.

https://windowsserver.uservoice.com/search?filter=merged&query=task%20scheduler%202019

 

 

 

@cround 

"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!

@TimRSA  Did you find a solution to the scheduled task issue?   I'm also frustrated at Microsoft.

 

I have about 30 VB Apps that are humming along on a Windows 2008 server using scheduled tasks.    They all do a variety of simple to complex tasks from pulling data and merging letters on a monthly basis, posting data on our website, converting data to crystal reports, etc.

 

It’s now past the time for us to get off of our Windows 2008 server so I’m taking the apps and converting them up from Visual Studio 2012 to Visual Studio 2019.    No real hurdles.   Everything is converting fairly clean and running great.

 

Problems begin when I set the apps up on Windows Server 2019.    We have a user that is used for processing tasks and has the appropriate rights on the server.   If the tasks are setup to run overnight and I leave the server signed on, the tasks process fine.    If I sign off of the server the tasks show that they ran and that they completed successfully, but never finish processing.   The status shows they completed at the same time the schedule is triggered, and most of the tasks normally should run 15 minutes to an hour.

 

Nothing in the event log to say it failed, and I have a good bit of error code built into each program that would fire an error if one was triggered.

 

The task is setup to “Run whether user is logged on or not”, and also “Run with highest privileges”. 

 

Did something change since 2008 regarding scheduled tasks that I should be aware of?    Any suggestions / help with this is appreciated.  

@KreativeKai Yeah I used the other guy's solution, I have a task that I check if my app pools are running every 1 min. so The only way I got it to work was not to use the "Daily" setting but to say "One time" and set this in repeat task every {time} for a duration of in my case every day going forward so Indefinitely.

 

TimRSA_0-1588782141349.png

 

@TimRSA  Appreciate the response.    I'll try this.    I might also write a service in Visual Studio to basically create my own scheduled task app to get around this issue.  

@TimRSA Is there a similar fix for tasks that I want to run weekly? The "repeat task every" option only seems to have 5min - 1hour, but that's way too frequently for my task.

Sorry for late question... If you set "One time" it will do the job. What will happen if system restarts? Will task begin again?

@aris_zoisUnfortunately ti does not re-run if the server reboots...

We have the same issue (worked prior to server 2019 but not any more) where we have:

Run Daily / Repeat every 5 minutes, Indefinitely.... NEVER Runs.

 

We fixed it by setting it up to:

Run Daily / Repeat every 5 minutes, for a period of one day.

@doublehelix The solution you suggested that makes things happen in case of restart is the change from "Indefinitely" to "for a period of 1 day". Thanks!

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.

 

gregp955_0-1619446848509.png

 

@Dave Patrick 

 

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 :)

@TimRSA Work for me. Thanks.

@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.

i 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