EventTrigger (triggerGroup) Element

Specifies a trigger that starts a task when a system event occurs.

<xs:element name="EventTrigger"
    type="eventTriggerType"
 />

The EventTrigger element is defined by the triggerGroup .

Parent element

Element Derived from Description
Triggers triggersType Specifies the triggers that start the task.

Child elements

Element Type Description
Delay (eventTriggerType) duration Specifies the amount of time between when the event occurs and when the task is started.
Enabled (triggerBaseType) boolean Specifies that the trigger is enabled.
EndBoundary (triggerBaseType) dateTime Specifies the date and time when the trigger is deactivated. The trigger cannot start the task after it is deactivated.
Repetition (triggerBaseType) repetitionType Specifies how often the task is run and how long the repetition pattern is repeated after the task is started.
StartBoundary (triggerBaseType) dateTime Specifies the date and time when the trigger is activated.
Subscription (eventTriggerType) string Specifies the XPath query that identifies the event that fires the trigger.

Attributes

Name Type Description
Id ID Identifier of the trigger.

Remarks

A maximum of 500 tasks with event subscriptions can be created. An event subscription that queries for a variety of events can be used to trigger a task that uses the same action in response to the events being logged.

For script development, an event trigger is defined by the EventTrigger object.

For C++ development, an event trigger is defined by the IEventTrigger interface.

Examples

For a complete example of the XML for a task that uses an event trigger, see Event Trigger Example (XML).

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]

See also

Task Scheduler