Task Element

Defines the task that is performed by the Task Scheduler service.

<xs:element name="Task"
    type="taskType"
>
    <xs:key name="PrincipalKey">
        <xs:selector
            xpath="td:Principals/td:Principal"
         />
        <xs:field
            xpath="@id"
         />
    </xs:key>
    <xs:keyref name="ContextKeyRef">
        <xs:selector
            xpath="td:Actions"
         />
        <xs:field
            xpath="@Context"
         />
    </xs:keyref>
    <xs:unique name="UniqueId">
        <xs:selector
            xpath="td:Principals/td:Principal|td:Triggers/td:BootTrigger|td:Triggers/td:RegistrationTrigger|td:Triggers/td:IdleTrigger|td:Triggers/td:TimeTrigger|td:Triggers/td:EventTrigger|td:Triggers/td:LogonTrigger|td:Triggers/td:SessionStateChangeTrigger|td:Triggers/td:CalendarTrigger|td:Actions/td:Exec|td:Actions/td:ComHandler|td:Actions/td:SendEmail"
         />
        <xs:field
            xpath="@id"
         />
    </xs:unique>
</xs:element>

Child elements

Element Type Description
Actions actionsType Specifies the actions performed by the task.
Data dataType Specifies addition data that is associated with the task, but is otherwise unused by the Task Scheduler service.
Principals principalsType Specifies the security contexts that can be used to run the task.
RegistrationInfo registrationInfoType Specifies administrative information about the task, such as the author of the task and the date the task is registered.
Settings settingsType Specifies the settings that the Task Scheduler uses to perform the task.
Triggers triggersType Specifies the triggers that start the task.

Remarks

For C++ development, see ITaskDefinition.

For script development, see TaskDefinition.

Requirements

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