LogonTriggerUserId Property

Gets or sets The identifier of the user. For example, "MyDomain\MyName" or for a local account, "Administrator".

This property can be in one of the following formats:

• User name or SID: The task is started when the user logs on to the computer.

• NULL: The task is started when any user logs on to the computer.

Definition

Namespace: Microsoft.Win32.TaskScheduler
Assembly: Microsoft.Win32.TaskScheduler (in Microsoft.Win32.TaskScheduler.dll) Version: 2.11.0
[DefaultValueAttribute(null)]
[XmlIgnoreAttribute]
public string UserId { get; set; }

Property Value

String

Implements

ITriggerUserIdUserId

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 LogonTrigger.UserId property. Instead, create a logon trigger with an empty LogonTrigger.UserId property and assign a value to the principal for the task using the Principal.GroupId property.

Exceptions

NotV1SupportedExceptionNot supported under Task Scheduler 1.0.

See Also