1

If a scheduled task fails on Windows Server 2003, is anything written to the event log? And if so, what Event ID does it have so I can set an Event Trigger to look for it, and email me?

leeand00
  • 4,869
  • 15
  • 69
  • 110

1 Answers1

2

No, Scheduled Tasks in Server 2003 do not make use of the Event Log. They log to a text file, SchedLgU.txt under \Windows\Tasks\. The simplest way I've found to generate emails based on that log is with PowerShell.

Select-String "\* error" should be able to find any failures in the log, and after that, it's just a matter of triggering an email when that's found... and ironically, yes, it's probably easiest to run your script to scan for Scheduled Tasks failures as a Scheduled Task.

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
  • hmm my server doesn't seem to have that file, do you have to turn it on? I've seen other places where people say it's named `tasks.csv`... – leeand00 Jan 14 '15 at 14:15
  • 1
    @leeand00 It should be there by default, [but it's not visible through the GUI, because the Tasks folder is one of those bloody special folders](http://www.sqlservercentral.com/Forums/Topic142809-5-1.aspx). Run a `dir` against the folder from PowerShell or cmd and it should show up just fine. (At least, it did on the handful of 2003 servers I'm still stuck with.) – HopelessN00b Jan 14 '15 at 14:30
  • 1
    @leeand00 - from the Scheduled Tasks window select the Advanced menu and then select View Log. – joeqwerty Jan 14 '15 at 14:35