?
Solved

Set all Windows Services to restart on first failure

Posted on 2009-05-02
3
Medium Priority
?
2,167 Views
Last Modified: 2013-12-14
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
Comment
Question by:drivencorp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Expert Comment

by:samiam41
ID: 24288288
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
 

Author Comment

by:drivencorp
ID: 24288375
Operating systems are both Windows 2003 and Windows 2008.
Appreciate your help.
0
 
LVL 85

Accepted Solution

by:
oBdA earned 2000 total points
ID: 24298469
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

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Determining the an SCCM package name from the Package ID
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question