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.
The ILogonTrigger interface inherits from the ITrigger interface.
The ILogonTrigger interface has these methods.
Gets or sets a value that indicates the amount of time between when the user logs on and when the task is started. (Get)
Gets or sets the identifier of the user. (Get)
Gets or sets a value that indicates the amount of time between when the user logs on and when the task is started. (Put)
Gets or sets the identifier of the user. (Put)
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.
For more information and example code for this interface, see Logon Trigger Example (C++).
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2008 [desktop apps only]|