Principal.LogonType property
For scripting, gets or sets the security logon method that is required to run the tasks that are associated with the principal.
Syntax
Principal.LogonType As Integer
Property value
Set to one of the following TASK_LOGON TYPE enumeration constants.
Value | Meaning |
---|---|
|
The logon method is not specified. Used for non-NT credentials. |
|
Use a password for logging on the user. The password must be supplied at registration time. |
|
Use an existing interactive token to run a task. The user must log on using a service for user (S4U) logon. When an S4U logon is used, no password is stored by the system and there is no access to either the network or encrypted files. |
|
User must already be logged on. The task will be run only in an existing interactive session. |
|
Group activation. The userId field specifies the group. |
|
Indicates that a Local System, Local Service, or Network Service account is being used as a security context to run the task. |
|
First use the interactive token. If the user is not logged on (no interactive token is available), then the password is used. The password must be specified when a task is registered. This flag is not recommended for new tasks because it is less reliable than TASK_LOGON_PASSWORD. |
Remarks
This property is valid only when a user identifier is specified by the UserId property.
When reading or writing XML for a task, the logon type is specified in the <LogonType> element of the Task Scheduler schema.
For a task, that contains a message box action, the message box will be displayed if the task is activated and the task has an interactive logon type. To set the task logon type to interactive, specify 3 (TASK_LOGON_INTERACTIVE_TOKEN) or 4 (TASK_LOGON_GROUP) in the LogonType property of the task principal, or in the logonType parameter of TaskFolder.RegisterTask or TaskFolder.RegisterTaskDefinition.
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows Vista [desktop apps only] |
Minimum supported server |
Windows Server 2008 [desktop apps only] |
Type library |
|
DLL |
|