LogonTrigger (triggerGroup) Element

Specifies a trigger that starts a task when a user logs on.

<xs:element name="LogonTrigger"

The LogonTrigger element is defined by the triggerGroup .

Parent element

ElementDerived fromDescription
Triggers triggersType

Specifies the triggers that start the task.

Child elements

Delay (logonTriggerType) duration

Amount of time between when the user logs on 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.

ExecutionTimeLimit (triggerBaseType) duration

Specifies the maximum amount of time in which the task can be started by the trigger.

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.

UserId (logonTriggerType) string

Identifier of the user. The task is started when this user logs onto the computer.


For scripting development, a logon trigger is specified using the LogonTrigger object.

For C++ development, a logon trigger is specified using the ILogonTrigger interface.

The child elements listed above are defined by the triggerBaseType and logonTriggerType complex element types. These elements must be added in the sequence shown below.


The attribute listed below is defined by the triggerBaseType complex element types.

  • Id: Identifier of the trigger.


For a complete example of the XML for a task that uses a logon trigger, see Logon Trigger Example (XML).


Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

See also

Task Scheduler Schema Elements