question

JoelLevy-4460 avatar image
1 Vote"
JoelLevy-4460 asked WolfScott-9366 commented

Task Scheduler [Server 2019]: runs tasks every week instead of every 2nd week

On Windows Server 2019, I have a weekly task which is set to "Recur every 2 weeks". It actually runs every week. The "next run time" shows correctly that it's scheduled to run again in 2 weeks but when it comes next week which it's supposed to skip it runs anyways.

windows-server-2019
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JiaYou-MSFT avatar image
0 Votes"
JiaYou-MSFT answered JiaYou-MSFT edited

HI JoelLevy-4460,

1.Please run below powershell command on issue server then share the result?
Get-TimeZone

2.Could you share the detail setting about "triggers", "action" , " conditions "and "settings" items of your issue task scheduler?

3.Did you select "allow task to be run on demand" and "run task as soon as possible after a scheduler task is missed"? like below picture
106388-22.png

4.Please try to create a simple bat file and set the same task scheduler setting as your issue one, then check if the same issue happen?(Is your current issue ralted to your original bat file?)


============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



22.png (17.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JoelLevy-4460 avatar image
1 Vote"
JoelLevy-4460 answered MotoX80 commented

Please note that the problem is that the task runs to many times. It should only run every other week but it actually runs every week. This would not be related at all to the batch or exe that is set to run as there is no way that the intended executable would cause the task to run at additional times.



PS C:\Users\sbv> Get-TimeZone


Id : Eastern Standard Time
DisplayName : (UTC-05:00) Eastern Time (US & Canada)
StandardName : Eastern Standard Time
DaylightName : Eastern Daylight Time
BaseUtcOffset : -05:00:00
SupportsDaylightSavingTime : True



I don't have the task anymore, (it's already changed) but will test a simple task as attached.
106771-1.png


106745-2.png


106772-3.png


106746-4.png



1.png (132.2 KiB)
2.png (59.5 KiB)
3.png (116.5 KiB)
4.png (111.6 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Have you examined the events in the History tab? Compare the events that happen when the task runs normally and when it runs at the wrong time. Do you see any events that would indicate what started the task at the wrong date/time?

0 Votes 0 ·
JoelLevy-4460 avatar image
0 Votes"
JoelLevy-4460 answered

Yes, the events for the for the wrong weeks look exactly the same as the events for the correct weeks.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MicahEllison avatar image
0 Votes"
MicahEllison answered

I have been having the exact same problem for around a month now. A few weeks ago, I deleted the task then re-created it, and that did not solve the problem. Here is a screenshot of the history of my task, which should only be running once every 2 weeks at 10:00am Fridays but is instead running every Friday.

I believe this is rock-solid evidence that it is a bug in Windows and not a user error, but if there is anything else that I can provide, please let me know.

107029-2021-06-18-windowstaskschedulerbug.png



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MotoX80 avatar image
0 Votes"
MotoX80 answered
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JiaYou-MSFT avatar image
0 Votes"
JiaYou-MSFT answered

HI JoelLevy-4460,

Do you install full update patches on issue w2019 server ?

server 2019 update history
https://support.microsoft.com/en-us/topic/windows-10-and-windows-server-2019-update-history-725fc2e1-4443-6831-a5ca-51ff5cbcb059

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JoelLevy-4460 avatar image
0 Votes"
JoelLevy-4460 answered MotoX80 commented

Not sure if I understand what full update patches are. It shows for me that my server is fully up to date:

108713-1.png



1.png (38.3 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HI

I create a test scheduler in my lab, I hope I can reproduce your issue.

0 Votes 0 ·

I did the same last Friday on my Win10 [Version 10.0.19043.1052] laptop. It ran at 10AM today.

I had written a Powershell script last year to monitor scheduled tasks.

https://social.technet.microsoft.com/Forums/en-US/c0be6139-5198-46b2-9135-4e6dae49adaa/scheduled-task-firing-on-the-wrong-day-consistently?forum=winserver8gen

I can post the most current script if anyone wants it. I added the command line switch for task name.


109415-capture.jpg


109463-capture1.jpg

109444-capture2.jpg


0 Votes 0 ·
capture.jpg (23.2 KiB)
capture1.jpg (26.3 KiB)
capture2.jpg (121.9 KiB)
JoelLevy-4460 avatar image
0 Votes"
JoelLevy-4460 answered

Here is a simple test task that was supposed to run on 6/18/21 and then skip 6/25/21, but it actually ran on 6/18/21 and also on 6/25/21.

111234-2.png


111165-1.png



2.png (87.0 KiB)
1.png (88.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JoelLevy-4460 avatar image
3 Votes"
JoelLevy-4460 answered WolfScott-9366 commented

FYI, there is a work around that will accomplish the same skipping a week feature. Instead of using the Weekly with the Recur feature, use instead the One time with the Repeat feutre as below. This will accomplish the same result and works good. However, the Weekly Recur is still broken and I need to use it because of a special setup. Any help would be appreciated.

111235-1.png



1.png (86.6 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HI

I am glad to hear that we get the work around temporarily, we can enter windows+F to feedback the issue.

0 Votes 0 ·

Thanks @JoelLevy-4460 for posting this nice workaround.

0 Votes 0 ·

I was excited to see this "workaround"; however, when checking my version, the only "repeat every" only goes up to 1 hour... :(
The extra events are quite a service disruptor when they run mid-cycle.
So sadly, not a workaround for me unless I'm missing something here.

This is an Azure instance:
Edition Windows 10 Pro
Version 21H1
Installed on ‎5/‎7/‎2021
OS build 19043.1237
Experience Windows Feature Experience Pack 120.2212.3530.0

135209-image.png


0 Votes 0 ·
image.png (44.4 KiB)

I think writing about your own issue causes the universe to line up or something --
I discovered that now the DAILY (radio button option) allows me to set "every 14 days". SO, I'm setting the start date to be a legit next run date and then set it for every 14 days. Will see how this runs.

The thing that DOES look hopeful is the text says "every 14 days" and not "every Saturday every 2 weeks" as was the case when trying to use the weekly option.

0 Votes 0 ·
Fab-1805 avatar image
0 Votes"
Fab-1805 answered

I have the same Problem on Windows 10 1809.
The problem began after install some MS Patches. I suspect KB5003243. This Patch was made for Windows Server 2019 and Windows 10 Version 1809.

Thanks for the workaround! I'm still testing.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.