• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2334
  • Last Modified:

Set all Windows Services to restart on first failure

I would like to set all Windows Services to restart on first failure. The default action in the Recovery tab is suprisingly 'Take No Action'. Does anybody know the fastest way to make all Automatic services that need to run to have the 'Restart the Service' selected as the First Failure option? The idea is to have 99.9% uptime for all services on my servers.
0
drivencorp
Asked:
drivencorp
1 Solution
 
samiam41Commented:
Is this for your NT4 server?  If so, they best way to ensure 99.9% uptime is to migrate to Windows 2003 or 2008.  ; )  Aside from that, manually may be the way to do it if time is critical.  If this is a learning process or you want to use it again, hopefully someone will have a script for you.  You may want to clarify the OS though.  

Good luck mate.
0
 
drivencorpAuthor Commented:
Operating systems are both Windows 2003 and Windows 2008.
Appreciate your help.
0
 
oBdACommented:
You can do this as a batch script with with sc.exe and a GPO *startup* (not logon!) script for the servers in question.
Note that
- you will not be able to change this for all services (Alerter, for example).
- in all likelihood, this won't change too much in terms of uptime/reliability. If a service fails, it usually fails for a reason, and that reason usually isn't fixed just by restarting the service.
That said, below's a syntax example for the Telnet server.
- You need the "real" service name, not the display name.
- Note the space after the "="!
- "reset= " defines the number of seconds after which the error counter is reset to 0; this *has* to be defined together with actions=
- "actions= " defines the actions to be taken after a failure, followed by the delay time in milliseconds separated by a "/"; just concatenate the first/second/third failure definitions (and for the third and following, I'd actually use "no action").
So this command will configure Telnet Server to reset the counter after 0 days (never), to restart after 60 seconds for the first failure, and to take no actions taken for the second or later failures.
sc failure "tlntsvr" reset= 0 actions= restart/60000////

Open in new window

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now