Bewerken

Delen via


Principals (taskType) Element

Specifies the security contexts that can be used to run the task.

<xs:element name="Principals"
    type="principalsType"
 />

The Principals element is defined by the taskType complex type.

Parent element

Element Derived from Description
Task taskType Defines the task that is performed by the Task Scheduler service.

Child elements

Element Type Description
Principal principalType Specifies the security credentials for a principal.

Remarks

You can specify up to 32 principals for a task.

For scripting development, the principals of a task are specified using the TaskDefinition.Principal property.

For C++ development, the principals of a task are specified using the Principal property of ITaskDefinition.

Examples

The following XML defines two principals: a user identifier and group identifier principal for the task.

<Principals>
    <Principal>
        <UserId></UserId>
        <LogonType><LogonType>
        <DisplayName></DisplayName>
    </Principal>
    <Principal>
        <GroupId></GroupId>
        <DisplayName></DisplayName>
    </Principal>
</Principals>

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]

See also

Task Scheduler Schema Elements

Task Scheduler