IPrincipal interface (taskschd.h)

Provides the security credentials for a principal. These security credentials define the security context for the tasks that are associated with the principal.

Inheritance

The IPrincipal interface inherits from the IDispatch interface.

Methods

The IPrincipal interface has these methods.

 
IPrincipal::get_DisplayName

Gets or sets the name of the principal. (Get)
IPrincipal::get_GroupId

Gets or sets the identifier of the user group that is required to run the tasks that are associated with the principal. (Get)
IPrincipal::get_Id

Gets or sets the identifier of the principal. (Get)
IPrincipal::get_LogonType

Gets or sets the security logon method that is required to run the tasks that are associated with the principal. (Get)
IPrincipal::get_RunLevel

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. (Get)
IPrincipal::get_UserId

Gets or sets the user identifier that is required to run the tasks that are associated with the principal. (Get)
IPrincipal::put_DisplayName

Gets or sets the name of the principal. (Put)
IPrincipal::put_GroupId

Gets or sets the identifier of the user group that is required to run the tasks that are associated with the principal. (Put)
IPrincipal::put_Id

Gets or sets the identifier of the principal. (Put)
IPrincipal::put_LogonType

Gets or sets the security logon method that is required to run the tasks that are associated with the principal. (Put)
IPrincipal::put_RunLevel

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. (Put)
IPrincipal::put_UserId

Gets or sets the user identifier that is required to run the tasks that are associated with the principal. (Put)

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 interface 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 NULL.

Examples

For more information and example code for this interface, see Time Trigger Example (C++) or Registration Trigger Example (C++).

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header taskschd.h

See also

ITaskDefinition

Principal Property of ITaskDefinition

Task Scheduler Interfaces