Principal object

Scripting object that provides the security credentials for a principal. These security credentials define the security context for the tasks that are associated with the principal.

Members

The Principal object has these types of members:

Properties

The Principal object has these properties.

Property Access type Description
DisplayName
Read/write
Gets or sets the name of the principal that is displayed in the Task Scheduler UI.
GroupId
Read/write
Gets or sets the identifier of the user group that is required to run the tasks that are associated with the principal.
Id
Read/write
Gets or sets the identifier of the principal.
LogonType
Read/write
Gets or sets the security logon method that is required to run the tasks that are associated with the principal.
RunLevel
Read/write
Gets or sets the identifier that is used to specify the privilege level that is required to run the tasks that are associated with the principal.
UserId
Read/write
Gets or sets the user identifier that is required to run the tasks that are associated with the principal.

Remarks

When specifying an account, remember to properly use the double backslash in code to specify the domain and user name. For example, use DOMAIN\\UserName to specify a value for the UserId property.

When reading or writing XML for a task, the security credentials for a principal are specified in the Principal element of the Task Scheduler schema.

If a task is registered using the at.exe command line tool, and this object is used to retrieve information about the task, then the LogonType property will return 0, the RunLevel property will return 0, and the UserId property will return Nothing.

Examples

For more information and example code for this scripting object, see Time Trigger Example (Scripting).

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
Type library
Taskschd.tlb
DLL
Taskschd.dll