Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Last Run Result Email Alert from Scheduled Task

$
0
0

Hi All,

Ive a newly require need to move 3 files from a local server to a remote server via FTP each evening.

Local server is a Server 2008 box.

I have setup WinSCP to transfer the files over successfully via a Scheduled Task

Now i need alerting!!

Ive setup the email function in Task Scheduler and it does send me an email but a pretty pointless one at that as it doesn't tell you the Last Run Result status code.

So all i know is the job has run but i don't know if with errors etc.

Each morning ill have to FTP to the remote server and manually check the time and date stamps myself to make sure the copy was successful.

Ive checked the event log and it writes an Event ID 201 to the Task Scheduler Event Log and that has all the info i need in the description, but i cant attach that event to my scheduled task as there are lots of 201's for all different scheduled tasks that run that by the OS.

Anybody know how i can get the last Run Result in the body of the email or the subject line at least - so i know if it is a 0x0 the job has been successul and anything other than 0x0 that there has been a problem.

Any suggestions?

Thanks in advance.

Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>