Task Scheduler Alert Task
We use Task Scheduler on Windows Server 2008 to run a few integration scripts. When those tasks fail, I’d like Task Scheduler to send me an email alert.
In Task Scheduler, I created a task with a trigger and the following Custom Event filter. The action on the task sends me an email whenever this trigger fires. This should help me catch the occasional script failure — as long as Task Scheduler and the server are still running.
<QueryList> <Query Id="0" Path="Microsoft-Windows-TaskScheduler/Operational"> <Select Path="Microsoft-Windows-TaskScheduler/Operational">*[System[(EventID=201)] and EventData[@Name="ActionSuccess"]/Data[(@Name="ResultCode")]!=0]</Select> </Query> </QueryList>
This article contains additional details on setting up a task to read an event log and send an alert.
data-text=”Task Scheduler Alert Task (Shannon Whitley)”