4

I set up a task in Server 2012 to run a script every weekday. It will work for anywhere from a few weeks to a few days, then just not even try to run it anymore.

Status: Ready
Triggers: At 7:30 AM every Monday, Tuesday, Wednesday, Thursday, Friday of every week starting 2/20/2013
Next Run Time: 3/22/2013 7:30:00 AM
Last Run Time: 3/8/2013 7:30:00 AM
Last Run Result: The operation completed successfully.(0x0)

The event history just shows that it completed successfully on 3/8/2013 and nothing at all about even trying to start the task beyond that.

Has anyone else run into something similar or know where to look next?

Edit: The next run time always showed correctly, but it just never ran. I was using the "Delay task for up to (random delay)" option which I have disabled. It has worked fine since then. I ended up doing the random delay in the script itself instead.

bogdan
  • 65
  • 11
Tamerz
  • 412
  • 3
  • 6
  • 14

4 Answers4

3

If your computer is making decisions on its own, it has become self-aware. You need to unplug it from the network and destroy it immediately, before you kick off the apocalypse, as predicted in the Terminator series. Use lots and lots of thermite, to make sure.

On the other hand, if you just chose your title poorly, and your computer has not actually started to think on its own, I'd check the scheduled task log file for anything obvious, (I don't know where it's located in 2012 off-hand, but in earlier versions of Windows, the default location was \Windows\Tasks\SchedLgU.txt). It records a lot more information than the Event Log captures, so it's the best place to look next.

Failing any clues there, delete the existing scheduled task, recreate it and see what results you get.

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
  • Sounds to me he was just trying to find out if other people are running into the same issue he is. Not sure if thermite is going to help him solve the issue. – Lucky Luke Mar 21 '13 at 21:47
  • Computers make decisions. It looks at input and decides what to do with it. In this case, it has input, and it is deciding not to run the task. That log does not exist, and I can't find any information anywhere if it was removed from 2012 or not. The operational logs however do not show anything. – Tamerz Mar 21 '13 at 21:50
  • 1
    @Tamerz No, computers do not make decisions. Either there is a programmatic explanation for why your scheduled task is not running, or you have the world's first and only self-aware computer. – HopelessN00b Mar 22 '13 at 12:40
  • 1
    I think when Tamerz says "it", he means Windows, that is, the code that Microsoft employees wrote. I don't think he's trying to imply that the computer is self-aware, as you seem to keep suggesting. Trusting his analysis, I'd assume there is a bug, and I don't think your comments about Terminator were particularly helpful. – Lucky Luke Apr 18 '13 at 18:42
0

I have a somewhat similar issue. I too have a scheduled task, in Server 2012, and the machine does not stick to the schedule.

Have you looked at the Next Run Time (a column in the top pane of the GUI?) I have a task scheduled to run every day. The (currently listed) next run time is 19May @01:30. I'd expect tomorrow 19April @01:30.

There has been a hotfix for a problem in this area against Server 2008. I have not seen anything against 2012 (http://support.microsoft.com/kb/2495489 - not really a fit for my problem as I have only a single trigger)

I have another task scheduled to run at 01:00 every day except Saturday. If I look in its history, there are days it ran at 12:00, days it ran at 01:00 and days it did both.

  • The next run time always showed correctly, but it just never ran. I was using the "Delay task for up to (random delay)" option which I have disabled. It has worked fine since then. I ended up doing the random delay in the script itself insetad. – Tamerz May 07 '13 at 15:58
  • I too did work in my script. I could only get same time, every day to work consistently. For stuff I wanted to run only every week I had the script check the day of the week. – RichardHowells May 08 '13 at 16:41
  • I also experienced the issue of having a Windows Server 2012 Task Scheduler task which used "random delay", not executing when Task Scheduler says it will. It just keeps getting rescheduled as expected but it never actually executes. What's very strange is that, in Task Scheduler's MMC, the Next Run Time shows a different value every time I refresh (F5) the list of tasks. I also asked the question on Microsoft's "community" forums [here](http://social.technet.microsoft.com/Forums/windows/en-US/04f7457e-0749-454f-b77d-de31371959f8/scheduled-task-never-executes-but-gets-rescheduled-unable-to-fin – bogdan Apr 30 '14 at 10:10
0

In my case it appeared that my domain password that I use to login to the server was changed. I checked the checkbox 'Run with highest privileges' and saved again with my new password. This fixed the issue for now. I assume running with the highest privileges will prevent me from doing this every 90 days..

RuudvK
  • 101
0
  1. Check your antivirus logs.
  2. You need to allow your account to run as Batch on your local security policies. Local Security Policy > Local Policies > User Rights Assignment > Log on as a batch job.
HEMAN85
  • 415
  • 3
  • 9