ILogonTrigger interface (taskschd.h)

Represents a trigger that starts a task when a user logs on. When the Task Scheduler service starts, all logged-on users are enumerated and any tasks registered with logon triggers that match the logged on user are run.

Inheritance

The ILogonTrigger interface inherits from the ITrigger interface.

Methods

The ILogonTrigger interface has these methods.

 
ILogonTrigger::get_Delay

Gets or sets a value that indicates the amount of time between when the user logs on and when the task is started. (Get)
ILogonTrigger::get_UserId

Gets or sets the identifier of the user. (Get)
ILogonTrigger::put_Delay

Gets or sets a value that indicates the amount of time between when the user logs on and when the task is started. (Put)
ILogonTrigger::put_UserId

Gets or sets the identifier of the user. (Put)

Remarks

If you want a task to be triggered when any member of a group logs on to the computer rather than when a specific user logs on, then do not assign a value to the UserId property. Instead, create a logon trigger with an empty UserId property and assign a value to the principal for the task using the GroupId property.

When reading or writing XML for a task, a logon trigger is specified using the LogonTrigger element of the Task Scheduler schema.

Examples

For more information and example code for this interface, see Logon Trigger Example (C++).

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header taskschd.h

See also

ITrigger

Task Scheduler

Task Scheduler Interfaces