2.2.1.18.3 TaskV2 Inner Element

Each TaskV2 inner element contains an embedded Task element, which follows the schema that is defined at [MSDN-TaskSchS]. The unique attributes that are found on the Properties element are defined in the following table.

Attribute name

Description

action

(optional) If specified, the value MUST be C, D, R, or U, corresponding to Create, Delete, Replace, and Update. If not specified, the default value is U.

  • Create: This action MUST be used to create a new scheduled task for users or computers.

  • Delete: This action MUST be used to remove a scheduled task for users or computers.

  • Replace: This action MUST be used to delete and re-create scheduled tasks for users or computers. The net result of the Replace action is to overwrite all existing settings associated with the scheduled task. If the scheduled task does not exist, then the Replace action creates a new scheduled task.

  • Update: This action MUST be used to modify settings of an existing scheduled task for users or computers. This action differs from Replace in that it updates only settings defined within the preference item. All other settings remain as configured in the scheduled task. If the scheduled task does not exist, then the Update action creates a new scheduled task.

name

Sets a name for the scheduled task. This name appears in Control Panel under the list of scheduled tasks for users or computers. To modify or delete a task, this name MUST match the name of the existing task as it appears in Control Panel for users or computers. Scheduled tasks and immediate tasks that have the same name will not conflict.

runAs

Configures the security context under which the task is run.

If the preference item is part of the Computer Configuration, by default, the task runs in the security context of the Task Scheduler service, which is typically the System account. If the preference item is part of User Configuration, by default, the task runs in the security context of the user who is logged on. The task runs only if the user is logged on to the computer but can continue after the user logs off.

To run a task under the security context of a specified account (enabling the task to run regardless whether that account is logged on), set the Run as option and then set credentials for the account. These fields apply only if the action selected is Create, Replace, or Update.

logonType

MUST be Group, Service Account, or InteractiveToken.

cpassword

(optional) The password of the runAs credentials. The password is encrypted by using an Advanced Encryption Standard (AES) key when the preference item is created.