We have a number of Windows Scheduled tasks that run on one Server 2008 Webserver (not R2) which is in a cluster.
We recently moved from an original webserver Cluster to a new webserver Cluser (Server 2008 - not R2).
The new webserver (in the cluster) running the Windows Tasks is setup the same as on the original we believe.
BUT we now find that on the new Windows Server the Windows Task Scheduler seems to want to instantly start each task three times.
If we set the option to queue up a new task we get:
Event ID 324 Task Scheduler queued instance "{9a1a8411-b042-45ff-8e6b-89874df230d7}" of task "\Client Reporting" and will launch it as soon as instance "{2bcc3df6-ea3b-4453-90c2-75b8b1946388}" completes.
If we set the option to stop an existing task we get:
Event ID 323 Task Scheduler stopped instance "{e685a910-b32b-414e-85fd-96bbe54314a2}" of task "\Client Reporting" in order to launch new instance "{4db66265-1f51-4ede-8535-ac7c3cb5c4c1}" .
Ticked settings:
Allow task to be run on demand.
Run task as soon as possible after a scheduled start is missed.
Stop the task if running for longer than 1 hour.
If the running task does not end when requested force it to stop.
Start the task only if the computer is on AC power.
Stop the task if the computer switches to battery power.
Selected option: If the task is already running - stop the existing instance.
Note: We moved the tasks from one server to another in the cluster to see if it the Task Scheduler on the particular server we'd picked causing the problem. Same behaviour.
Could it be something to do with the build of the new servers?
We have very similar tasks set up on another server cluster that work OK without all this multiple starting. Comparing those tasks to the ones here - there does not seem to be anything obviously different in terms of settings available to us through the options within the Task Scheduler.
Trigger: The task is scheduled to be triggered daily, once an hour - and to be stopped if it exceeds this time.
Action: Runs a .bat file.
What could be causing this/where we can look to see what logic is causing the tasks to start multiple times in this way?
This is the issue described in KB2617046: if you disable and then enable a scheduled task, duplicate triggers are created. The task properties still shows only one trigger, but you can see that the task is triggered multiple times simultaneously in the task history.
There is a hotfix available from Microsoft. The hotfix says it is for Vista, but it works on Server 2008 SP2. After applying the hotfix, you have to disable and then re-enable the trigger on your task (closing the trigger properties window in between to apply the changes) in order to get rid of the duplicates.
We managed to stop Windows Task Scheduler starting up multiple processes by ticking the option "If the task fails, restart every:" with the defaults of "1 minute" and "Attempt to restart up to: 3 times".
This seemed counter-intuitive as
and 2. the tasks already seemed to be deciding to start three times anyway.
Also - we have these same tasks setup on Test webservers and have not needed to tick this option.
For whatever reason I can't add a comment to your answer, however it is likely "failing" because the task is returning a exit code other than 0. You can fix this by scheduling a script to run instead of the actual task process. You would have the script run the actual task process, and after it completed check the exit code of the process against a list of known success codes. If it is a success, have the script exit with code 0 and if it was not a success, pass the failure exit code. This way you still retain the ability of task scheduler to rerun the task in case is actually fails.
Unfortunately it is not uncommon for processes which successfully executed to return exit codes other than 0. You would need to check the documentation (or ask the developer) about what the various exit codes are.
I faced this issue on WinServer2008 R2 a couple of months ago. I tried many solutions but nothing solved the issue.
the following seems to solve the issue : On Task Scheduler Application : select the task : then from the right menu click 'End', it will ask you 'Do you want to end all instances of this task?' click 'Yes'.
I hope this will solve your issue.
The same issue was happeing here any task gets in queue so browsed all the task which were running or in queue end them all and restarted the server it was fixed