1

I have a backup service running through TaskScheduler.
The backup task runs a batch-file which does all the magic.
Sometimes the backup fails which fills a log table until the server becomes unresponsive (this is a whoooole different issue...)

I'm trying to create a separate task that sends me an email when the backup task fails.

So far I've created a powershell script that sends the email without problems. The script is called through a "failed backup email" task without problems.

My problem is getting the email-task to trigger. The backup-task doesn't seem to generate any events that triggers the write to the event log. The event history is turned on.

This is the script I've set up for the trigger:

<QueryList>
<Query Id="0" Path="Microsoft-Windows-TaskScheduler/Operational">
<Select Path="Microsoft-Windows-TaskScheduler/Operational">*[System[(EventID=101 or EventID=103 or EventID=111 or EventID=311 or EventID=329)]] and *[EventData[Data and (Data='backup db')]]</Select>
</Query>
</QueryList>

The list of ids to trigger on I got from this post: https://mnaoumov.wordpress.com/2014/05/15/task-scheduler-event-ids/

How can I get the email-task to trigger?

LotPings
  • 1,015
  • 7
  • 12
kumaheiyama
  • 111
  • 3
  • Without knowing your (apparently not so **magic**) batch it is difficult to give any hint. In the batch you could possibly use `eventcreate.exe` if the logtable problem is detectable. – LotPings Jul 10 '17 at 11:55

0 Answers0