Solved

Set all Windows Services to restart on first failure

Posted on 2009-05-02
3
2,069 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 84

Accepted Solution

by:
oBdA earned 500 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
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…

726 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