Questions

How do log failed scheduled task in Event viewer in Windows 2003

+
0 Votes
Locked

How do log failed scheduled task in Event viewer in Windows 2003

makrand_n123
Dear Team,

Please help me to log failed scheduled task in Event viewer Windows 2003

thanks

Makrand
+
0 Votes
seanferd

Open the scheduler, and look under the Advanced menu item. There is a log, and you can set it to notify you as well.

Do you get any errors while creating the task?

+
0 Votes
makrand_n123

Thanks for initial help
where misssed task will get stored or can we see that Event viewer

+
0 Votes
seanferd

I don't think you can get it to show in event viewer, unless it shows as an audit failure.

In application log, it will show that the scheduler has started, but I don't think you'll get a failure entry for the application the scheduler is supposed to start.

Scheduled Tasks > Advanced > Show log
Lists specific failure codes & reasons

+
0 Votes
scott_heath

Are you running your own script or an executable that generates an exit code? Run it via a batch file and use %errorlevel% to check for a failure and use eventcreate.exe to make your own event log entry.

Regards,
Scott

http://scottisageek.spaces.live.com

+
0 Votes
thommck

We had this issue on an old Windows 2000 server.
I fixed it by getting PowerShell (on a 2008 R2 server) to remotely read the log file for errors and email me the results daily.

Use this command to scan the log file for errors
Select-String "\* error" \\Server\winnt\SchedLgU.txt | |format-table LineNumber, line -AutoSize

or use this command to get the contents of the whole file
Get-Content \\Server\winnt\SchedLgU.txt

You can then add other things in the script to email results, create a marker file or whatever you need.
P.S. I had to share the Winnt directory before I could read the file remotely

+
0 Votes

FOUR YEARS!!! That's how long it has been since this question was
asked and answered. Do you REALLY think anybody is going to keep
checking it after 4 years? Don't wake the dead, let them rest in peace.
Thank you,
wizard57m-cnet
TR Moderator

+
1 Votes
thommck

If something comes up as the top result on a google search then it deserves to have an answer!
The internet doesn't have expiry dates, if it did this page would have been deleted