3

We would like to scheduled a task on Windows Server on all weekdays. At the same time, the task should be disabled on the holidays. Please advise.

Bryan
  • 7,538
  • 15
  • 68
  • 92
user47289
  • 41
  • 1
  • 1
  • 3

4 Answers4

3

If this is a Windows Server 2008 - you can try the below from the Task Scheduler -

Screenshot for the Task Scheduler Trigger window pane

You can then uncheck the days you dont want the task to run as I have highlighted in blue.

I believe this is what you are looking for...

ServerFaulter
  • 181
  • 2
  • 13
1

Well, One way I see to do this is to the task to end on a holiday, then have a second task starting on the next working day, and ending that task the next holiday. Rinse and repeat per holiday.

enter image description here

The newer versions of task scheduler does seem to let you string events together, but I don't see any option not to run a task on a specific day.

Journeyman Geek
  • 6,969
  • 3
  • 31
  • 49
  • This looks cool. Say we have 10 business holidays, then will have 10 scheduled tasks. Thanks a lot. – user47289 Oct 19 '12 at 08:51
  • Could please give more info on string events together on the new task scheduler. – user47289 Oct 19 '12 at 09:00
  • On windows 7 (I don't have server 2012) You can set multiple triggers for the same task - so 10 triggers rather than 10 separate tasks under create tasks. Create basic tasks is closer to the options windows XP does. – Journeyman Geek Oct 19 '12 at 09:47
0

I understand this is a rather old question, but I had the same question. I have an autodialer program that runs via the task scheduler. For obvious reasons I do not want it to run on holidays. My customers would be unhappy if I called them on a holiday.

My solution to the problem is simple. I created another task for the holidays. It runs a powershell script that disables the autodialer task. Once the holiday is over another task is run to re-enable the the task.

The powershell function that I use is Disable-ScheduledTask.

Disable-ScheduledTask -TaskName "AutoDialerStart" Enable-ScheduledTask -TaskName "AutoDialerStart"

Parallogix
  • 11
  • 3
-2

Better answer to what has already been suggested. Set multiple triggers but do it by month so separate trigger for each month and you can choose which days to run. Triggers will be checked sequentially and if they meet the date requirement, that specific trigger will run. Holidays and weekends can be left unselected. At the beginning of each year you would need to reset the days for each trigger you want the task to run but you can call that yearly maintenance. Or hell, set the triggers out for three years or so.. Whatever works for you.