XML needed to insert content into e-mail body of task scheduler notification RRS feed

  • Question

  • Using Windows Server 2008 R2, I have created scheduled tasks to run a batch file.  I have then created a custom filter to trigger an e-mail notification when the task is complete.

    I am now receiving the e-mail alerts, but the e-mail body is blank.  I would like some information included in the e-mail.  I have modified the XML to include <valuequeries> tags I found while searching, but I still get an empty e-mail.  Below is that piece of the XML.

          <Subscription>&lt;QueryList&gt;&lt;Query Id="0" Path="Microsoft-Windows-TaskScheduler/Operational"&gt;&lt;Select Path="Microsoft-Windows-TaskScheduler/Operational"&gt;*[System[(EventID=102)]] and * [EventData[Data[@Name='TaskName']='\Update ISYS Analyst Consultants']]&lt;/Select&gt;&lt;/Query&gt;&lt;/QueryList&gt;</Subscription>
            <Value name="eventChannel">Event/System/Channel</Value>
            <Value name="EventRecordID">Event/System/EventRecordID</Value>
            <Value name="eventSeverity">Event/System/Level</Value>

    The text about following <Subscription> did not paste correctly and added several & where they do not exist. The portion of the code I am concerned with is the <valuequeries>. This does not seem to be adding anything to the e-mail body.

    I am trying to add content from the event log entries into the e-mail body.  Please let me know what I am missing and/or what information is available from the event logs to add to the message body.

    Monday, October 14, 2013 4:51 PM