2

I am familiar with the solution provided here: Make Windows Task Scheduler alert me on fail
However, that triggers when any task fails. I only want to receive an alert if a task from the "User" folder fails (which contains about 15 tasks):

enter image description here

I tried writing a custom XML filter to only select events with ID 203 that have "User" in their task name, but I found that the "contains" condition is not supported.

How can I get an alert only when one of the tasks in the "User" folder fails?

1 Answers1

0

I have not found an elegant solution to this. Only a manual workaround where, using a custom XML filter, I check for every task name under the User folder (they are all named "My task "), combine that with the "failed task" EventID of 203 and set that as a trigger.

<QueryList>
  <Query Id="0" Path="Microsoft-Windows-TaskScheduler/Operational">
    <Select Path="Microsoft-Windows-TaskScheduler/Operational">
      *[EventData[Data[@Name='TaskName'] and (Data='\User\My task 05' or Data='\User\My task 08' or
      Data='\User\My task 09' or Data='\User\My task 10' or Data='\User\My task 17' or
      Data='\User\My task 18' or Data='\User\My task 21' or Data='\User\My task 23' or
      Data='\User\My task 99')]]
      and
      *[System[(EventID=203)]]
    </Select>
  </Query>
</QueryList>

More flexible solutions are still very welcome!