Compartilhar via


Configure a Scheduled Task Item

Applies To: Windows Server 2008

Scheduled Task preference items allow you to 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 and configure any options desired. (For more information, see Configure Common Options.)

  8. Click OK. The new preference item appears in the results 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 recreate 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 in that it only updates 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.

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 the 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 the Control Panel for computers or users. Preference items configuring tasks with the same task name can conflict.

Run

Type the command to be run, not including 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 for the task when launched. 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.

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 allowing it to 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 execute 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 allow a daily, weekly, or monthly task to 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.

  • Although only one schedule can be active for a task, you can configure a list of several schedules from which end users can select. To do so, 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 selected.

Note

To return to a single schedule display, delete all but 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 in use, 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