The Services preference extension allows you to configure existing services on computers by using a Service preference item. Before you create a Service preference item, you should review the behavior of each type of action possible with the extension.

Creating a Service item

To create a new Service 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, expand the Preferences folder, and then expand the Control Panel Settings folder.

  3. Right-click the Services node, point to New, and select Service.

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

  5. Enter service settings for Group Policy to configure or remove. (For more information, see "Service settings" in this topic.)

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

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

Service actions

No change

Using this action does not change the running status of the named service.

Start service

Use this action to start the named service. This action has no effect if the named service is running.

Stop service

Use this action to stop the named service. This action has no effect if the named service is stopped.

Restart service

Use this action to stop and restart the named service.

Restart service if required

Use this action to stop and restart the named service if there is a configuration action that requires a restart.

Note

Starting and stopping a service occurs after the preference extension processes all other configuration settings. It is this reason that services cannot be started or restarted if the Startup mode is set to disabled.

Service settings

Startup

Choose the startup type for the service

  • No change: Use this setting when you do not want to change the startup type.

  • Automatic: Use this setting to configure the service to automatically start during the boot and logon process.

  • Disabled: Use this setting to disable the service. Disabling the service prevents the service from starting.

  • Automatic (Delayed Start): Use this setting to configure the service to automatically start during the boot and logon process. The startup of the service is briefly delayed during the logon process to increase logon performance.

Service name

Type the unique name for the service, or click Browse (…) to select a service from a list of installed services on the current computer.

Important

A service's unique name does not always match its display name. For example, the unique name of the Server service is LanmanServer.

Wait timeout if service is locked

Type a timeout value in seconds the preference extension waits to write configuration data, if the service is locked or transitioning from a stop, started, or restarted state,

Log on as: No change

Use this setting to keep the service's logon credentials as previously configured.

Log on as: Local System account

Use this setting to change the service's logon credentials to the Local System account.

Allow service to interact with desktop

Select this check box to allow the service to interact with the desktop. This setting is unavailable until you click the Local System account option.

Log on as: This account

Use this setting to change the service's logon credentials to a specific local or domain user. This account and Password settings become available once you click this option.

This account

Type or click browse (…) for the user name you are using for the service's logon credentials.

Password

Type the password used to authenticate the user. Type the same password in the Confirm Password box.

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.

Recovery actions

Configure how the computer responds if the service fails after one, two, or more attempts.

No Change

Use this setting when you do not want to change the recovery action of a service failure. The preference extension does not modify the recovery action when this setting is selected.

Take No Action

Use this setting to configure the service not to respond to a failing condition.

Restart the Service

Use this setting to configure the service to restart under the failing condition.

Restart the Computer

Use this setting to configure the service to restart the computer under the failing condition.

Recovery settings

Restart fail count after

Type the number of days that must pass before the service fail count is reset. This setting is available when at least one of the recovery actions is set to any setting other than No Change.

Start service after

Type the number of minutes that must pass before the failing service is restarted. This setting is available only when at least one of the recovery actions is set to Restart the Service.

Program

Type the full path for the program you want launched in response to the recovery action Run a Program. Or, you can Browse (…) for the application. Use the Command line parameters box to provide additional command line arguments for the program. This setting is available only when at least one of the recovery actions is set to Run a Program.

Restart Computer Options

Click Restart Computer Options to set that wait time before restarting a service. Also, you can provide a message to broadcast to network computers to alert users of the pending computer restart.

Additional considerations

  • Use the format .\username to specify a local user account on multiple computers.

  • Use the format domain\username to specific a domain account.

  • A password is required for all user account names except accounts for which the domain portion of the user credentials begins with NT AUTHORITY.

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

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

Additional references