11.29 StopServices

Use this Knowledge Script to stop Windows services in response to an event.

NOTE:If the service you specify has dependent services, you must list the dependent services before the primary service. For example, SQLServerAgent is a dependent service of MSSQLServer. To stop MSSQLServer and its dependent service, specify SQLServerAgent,MSSQLServer for the Service name(s) parameter. In cases with multiple dependent services, specify the most dependent service first and the least dependent service last.

11.29.1 Setting Parameter Values

Set the following parameters as needed:

Parameter

How to Set It

Event Notification

Raise event if service is successfully stopped?

Select Yes to raise an event if the services you specify are successfully stopped. The default is unselected.

Event severity -- Service stopped successfully

Set the event severity level, from 1 to 40, to indicate the importance of an event in which services are successfully stopped. The default is 25 (blue event indicator).

This Knowledge Script always raises an event when it is unable to stop a service.

Raise event if service is already stopped?

Select Yes to raise an event if the services you specify are already stopped. The default is unselected.

Event severity -- Service already stopped

Set the event severity level, from 1 to 40, to indicate the importance of an event in which specified services are already stopped. The default is 25 (blue event indicator).

Raise event if service is missing?

Select Yes to raise an event if the services you specify are missing. The default is unselected.

Event severity -- Service missing

Set the event severity level, from 1 to 40, to indicate the importance of an event in which specified services cannot be found. The default is 25 (blue event indicator).

Event severity -- Action failure

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the StopServices job fails. The default is 10 (red event indicator).

Severity Configuration

Minimum event severity for Action

Set the minimum severity level, from 1 to 40, for an event that triggers this Action. The default is 1.

Maximum event severity for Action

Set the maximum severity level, from 1 to 40, for an event that triggers this Action. The default is 40.

Action

Service name(s)

Provide a comma-separated list of the services you want to stop. You can use the service name or display name listed in the Properties dialog box for the service.

NOTE:If the service you specify has dependent services, enter the dependent services before the primary service. For example, SQLServerAgent is a dependent service of MSSQLServer. If you want to stop MSSQLServer and all of its dependent services, specify SQLServerAgent,MSSQLServer.

Service stop timeout

Set the number of seconds to attempt to stop the specified services before timing out. The default is 30.