Solved

Set all Windows Services to restart on first failure

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

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

776 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