Delay Tasks Using Group Policy

You are here:
< Back

Goal / Scope

Create a Group Policy Object or modify an existing Group Policy Object to run a scheduled task once a user has logged on to the system.

Background

This will only be effective using Window Vista (or later) Operating Systems.

Methodology / Process Steps

Edit the Group Policy Object to be used for pushing the new task.  Expand the User section, and locate the preferences section and expand it.  Now Expand the Control Panel section and locate Scheduled Tasks and select it.

GPP-ScheduledTasks

In the right hand pane, right clicking will display a menu.  Selecting “New” will display a sub menu.  Locate and select “Scheduled Task (Windows Vista and later)”.  This is the only option that can be used for setting the special delay option.  Once the new dialog window is displayed, configuration of the task can be started.  Begin by entering a name for the task.  Next select the user credentials this task should be run under.  By default, the logged on user will be supplied in the form of variables.  Run only when user is logged on is the recommended option as the goal is to run something a set time after a user logs on to the workstation.  Selecting “run with highest privileges” is recommended if the script is having problems executing due to permissions.

ST-GeneralTab

Next click on the “triggers” tab and click “new …” at the bottom.  This will open a dialog box allowing the creating of a trigger.  In the “begin the task” dropdown menu, select when the task should be initiated.  In this example “At log on” will be selected.  Depending on what is being accomplished, it may be necessary to specify a specific user, but the default is any user logon will trigger the event.

ST-TriggerTimeOptions

The next step is the important one, under the “Advanced” section, place a checkmark in “Delay task for” and select a time frame from the drop down that meets the requirements of the task.  The options are slightly limited, but other options (under the Conditions tab) help offset these.

ST-Triggers

Once all the settings have been configured correctly, clicking “Ok” will set the trigger.  Multiple triggers can also be setup.  Next under the “Actions” tab, the task can be configured (i.e. what will be run or executed when a trigger is triggered.)  Aside from starting a program or a script, an email can be sent and a message can be displayed.

ST-ActionOptions

The configuration of what action should be executed is simply setting the location of the program or script and adding any arguments.

ST-ActionsTab

Clicking “Ok” will complete the creation of the action.  Several actions can also be configured.

The next tab, the “Conditions” tab, allows specific additional conditions such as checking if the workstation is running on battery or wake up the workstation to run the task, and more importantly check if a network connection exists and only run if a connection is established.

ST-ConditionsTab

Finally, under the “Settings” tab provides options for retrying the action if it fails, stopping the action, and removing the action.  In this example, the action is retried 5 additional times every 5 minutes.

ST-SettingsTab

The common tab is the same as any other Group Policy Preference and item level targeting and run once options can be set as well.

ST-CommonTab

Known Issues / Troubleshooting

This section is for the issues that have well defined and tested solutions.

No known issues currently.

References

N/A

Last Updated On October 24, 2017