次の方法で共有


Set up Recovery Actions to Take Place When a Service Fails

Applies To: Windows 7, Windows 8, Windows Server 2008 R2, Windows Server 2012

If a service fails, you can use the Services snap-in to specify what action to take (for example, running a program or script) on the first or second service failure, or on subsequent failures.

Membership in Account Operators , Domain Admins , Enterprise Admins , or equivalent, is the minimum required to complete this procedure. Review the details in "Additional considerations" in this topic.

To set up recovery actions to take place when a service fails

  1. Click Start , in the Start Search box, type services.msc , and then press ENTER.

  2. In the details pane, right-click the service for which you want to set up recovery actions, and then click Properties .

  3. On the Recovery tab, click the action that you want in First failure , Second failure , and Subsequent failures , and then click OK .

    • If you click Run a Program , under Run program , type the full path for the specified computer. Universal Naming Convention (UNC) names are not supported. For example, type C:\scripts\handlefailure.cmd , rather than \\computername\c$\scripts\handlefailure.cmd . Programs or scripts that you specify should not require user input.

    • If you click Restart the Computer , click Restart Computer Options to specify how long the computer waits before restarting. You can also create a message to send automatically to remote users before the computer restarts.

    • Select Enable actions for stops with errors in order to trigger the recovery actions that the service stopped with an error.

Additional considerations

  • To perform this procedure, you must be a member of the Account Operators group, the Domain Admins group, the Enterprise Admins group, or you must have been delegated the appropriate authority. As a security best practice, consider using Run as to perform this procedure.

  • Recovery actions are available only on computers running Windows 2000 or later.

Additional references