Obtain an alert when a Windows Task Scheduler Task has completed

1

0

Is there any way to trigger an action when the Task Scheduler has completed a task? Ideally the action would be an e-mail. We have a situation where an ordered number of tasks export daily backups to removable media. Ideally we would like to be alerted when the last of these tasks has run successfully so that we know it is safe to remove the media.

ian

Posted 2015-03-31T10:52:59.790

Reputation: 11

3Yes, add the functionality to the end of the task you're running! Task schedulers job is to start a task, it has no idea if the program it starts was successful in what it wanted to do, as such, if you are executing a script then you need to add the email functionality to the end of that script – Dave – 2015-03-31T12:12:57.160

Answers

2

Add the functionality to the end of the task you're running!

Task schedulers job is to start a task, it has no idea if the program it starts was successful in what it wanted to do! Therefore, it can't know that it completed successfully.

As such, if you are executing a script to perform the back up then you need to add the email functionality to the end of that script.

Dave

Posted 2015-03-31T10:52:59.790

Reputation: 24 199

1Bit beyond me, but it is possible to re-use the task scheduler itself, to do the actual e-mail send or requester message. Use the event system to leave worked or didnt work "error" codes in an event. then another schedule that triggers off the event to send the e-mail. I suppose that might be easier for some to get the e-mail aspect of it scripted/programmed. – Psycogeek – 2015-03-31T21:56:29.197

0

Like Dave had mentioned, sending an email could be added to the end of your script. For example, the Send-MailMessage cmdlet could be used if using PowerShell. Alternatively, there are a variety of task scheduling solutions that could trigger off of the completion of a task and then send an email.

KevinV

Posted 2015-03-31T10:52:59.790

Reputation: 1

This is really more of a comment or observation than an actual solution. Answers should explain how to solve the problem. – fixer1234 – 2015-04-06T15:31:29.397