ILogonTrigger interface

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.

Members

The ILogonTrigger interface inherits from ITrigger. ILogonTrigger also has these types of members:

Properties

The ILogonTrigger interface has these properties.

PropertyAccess typeDescription

Delay

Read/write

Gets or sets a value that indicates the amount of time between when the user logs on and when the job is started.

Enabled

Read/write

Inherited from the ITrigger interface. Gets or sets a Boolean value that indicates whether the trigger is enabled.

EndBoundary

Read/write

Inherited from the ITrigger interface. Gets or sets the date and time when the trigger is deactivated. The trigger cannot start the task after it is deactivated.

ExecutionTimeLimit

Read/write

Inherited from the ITrigger interface. Gets or sets the maximum amount of time that the task launched by this trigger is allowed to run.

Id

Read/write

Inherited from the ITrigger interface. Gets or sets the identifier for the trigger.

Repetition

Read/write

Inherited from the ITrigger interface. Gets or sets a value that indicates how often the task is run and how long the repetition pattern is repeated after the task is started.

StartBoundary

Read/write

Inherited from the ITrigger interface. Gets or sets the date and time when the trigger is activated.

Type

Read-only

Inherited from the ITrigger interface. Gets the type of the trigger.

UserId

Read/write

Gets or sets the identifier of the user.

 

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

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Taskschd.h

Library

Taskschd.lib

DLL

Taskschd.dll

See also

Task Scheduler Interfaces
Task Scheduler

 

 

Community Additions

ADD
Show:
© 2014 Microsoft