Click to Rate and Give Feedback
MSDN
MSDN Library
Task Scheduler
Principal
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.

Methods

The Principal object does not define any methods.

Properties

The Principal object defines the following properties.

PropertyAccess typeDescription

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

Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
Type LibraryTaskschd.tlb
DLLTaskschd.dll

See Also

Task Scheduler Objects
Task Scheduler

Send comments about this topic to Microsoft

Build date: 11/12/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker