For computers that are running Windows Server® 2008 R2, Windows® 7, Windows Server 2008, Windows Vista®, Windows Server 2003, or Windows XP, Scheduled Task preference items let you create, replace, update, and delete scheduled tasks and their associated properties. Before you create a Scheduled Task preference item, you should review the behavior of each type of action possible with this extension.

Configuring a Scheduled Task item

To create a new Scheduled Task preference item
  1. Open the Group Policy Management Console. Right-click the Group Policy object (GPO) that should contain the new preference item, and then click Edit.

  2. In the console tree under Computer Configuration or User Configuration, expand the Preferences folder, and then expand the Control Panel Settings folder.

  3. Right-click the Scheduled Tasks node, point to New, and select Scheduled Task.

  4. In the New Scheduled Task Properties dialog box, select an Action for Group Policy to perform. (For more information, see "Actions" in this topic.)

  5. On the Task tab, enter task settings for Group Policy to configure or remove. (For more information, see "Task settings" in this topic.)

  6. If creating, updating, or replacing a task:

    1. Click the Schedule tab, and configure one or more schedules for the task. (For more information, see "Schedule settings" in this topic.)

    2. Click the Settings tab, and enter any additional task settings for Group Policy to configure. (For more information, see "Other scheduled task settings" in this topic.)

  7. Click the Common tab, configure any options, and then type your comments in the Description box. (For more information, see Configure Common Options.)

  8. Click OK. The new preference item appears in the details pane.

Actions

This type of preference item provides a choice of four actions: Create, Replace, Update, and Delete. The behavior of the preference item varies with the action selected and whether the scheduled task already exists.

Create

Create a new scheduled task for users or computers.

Delete

Remove a scheduled task for users or computers.

Replace

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

Modify settings of an existing scheduled task for users or computers. This action differs from Replace because it only updates settings that are 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.

Task settings

Note

All text fields accept preference processing variables. Press F3 to display a list of variables from which you can select.

Name

Type a name for the scheduled task. This name will appear in the list of scheduled tasks in Control Panel 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 computers or users. Preference items configuring tasks with the same task name can conflict.

Run

Type the command to be run, excluding any arguments.

This field is available only if the action selected is Create, Replace, or Update.

Arguments

Type any command-line arguments required.

This field is available only if the action selected is Create, Replace, or Update.

Start in

To specify the working directory for the command being run (typically to ensure the correct resolution of any relative file names), type the working directory used when the task is run. Do not include quotation marks or a trailing slash.

This field is available only if the action selected is Create, Replace, or Update.

Comments

Type a description of the task. This description is visible for users or computers to which this preference item is applied.

This field is available only if the action selected is Create, Replace, or Update.

Run as

Configure the security context under which the task is run.

  • If the preference item is part of Computer Configuration, by default the task is run in the security context of the SYSTEM account.

  • If the preference item is part of User Configuration, by default the task is run in the security context of the logged-on user. The task is run 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 of whether that account is logged on), select the Run as check box and enter credentials for the account.

Security Note

This password is stored as part of the GPO in SYSVOL and is discoverable, although obscured. If you choose to store passwords in preference items, you should consider creating dedicated accounts for this purpose, and never store administrative passwords in preference items.

These fields are available only if the action selected is Create, Replace, or Update.

Enabled

Select this check box so that the task will run. To configure the task for users or computers without letting it run, clear this check box.

This check box is available only if the action selected is Create, Replace, or Update.

Schedule settings

If creating, updating, or replacing a task, configure the frequency with which to run the task on the Schedule tab. For a task scheduled to be run daily, weekly, monthly, or one time only, select the start time at which to begin the task.

Configure any optional scheduling settings desired:

  • To let a daily, weekly, or monthly task run only during a specific range of dates, click the Advanced button, and select a Start Date and End Date.

  • To run the task repeatedly, click the Advanced button, select Repeat task, and configure the frequency and end time or duration.

  • You can configure multiple schedules. To do this, select the Show multiple schedules check box. For the first schedule that you want to create, select a frequency, start time, and any advanced options for the task. Click New to add another schedule to the list, and then configure settings for it. Any schedule modifications are applied to the schedule currently viewed, but all the schedules are run.

    Note

    To return to a single schedule display, delete all except one of the schedules in the list, and then clear the Show multiple schedules check box.

Other scheduled task settings

If creating, updating, or replacing a task, configure settings to manage the behavior of the task upon completion, if the computer is being used, or under specific power conditions on the Settings tab.

Additional considerations

  • You can use item-level targeting to change the scope of preference items.

  • Preference items are available only in domain-based GPOs.

Additional references