Solved

Auto toggle a service on Windows 2003 Server R2 using a scheduled event or other means.

Posted on 2007-11-22
4
218 Views
Last Modified: 2010-05-18
I have a mail service running on my Win2003 server which hangs once in a while. I need to shut down the service and turn it back on twice a day.  Is there any way to do this using a scheduled event or some other way? I don't see how a scheduled event can do this.  The mails services need to be toggled off then on very quickly, in a matter of a few seconds to avoid loosing mail connectivity.
0
Comment
Question by:Janrow
[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
  • 2
4 Comments
 
LVL 22

Assisted Solution

by:Rick Hobbs
Rick Hobbs earned 150 total points
ID: 20337254
You can use the at command or the scheduler.
AT command:
http://support.microsoft.com/kb/313565
create two cmd files, one to start the service, one to stop the service.  Remember:  if the service name has spaces in it enclose it in quotes.
There is also an inexpensive progran called firedaemon (www.firedaemon.com) that has a lot more feature than scheduler or the at command and can do exactly what you want.
0
 
LVL 2

Accepted Solution

by:
pinkisthenewblue earned 350 total points
ID: 20337462
Rather that doing two scheduled tasks just do it in one. And if you struggle with the AT command (I always do) just open scheduled tasks in my computer. A script (.bat) to stop and start:

net stop "my service name"
net start "my service name"

Just add the script to a scheduled task. Shouldn't take more than 10 seconds to execute (at the very most).

NB if the net commands don't like the service name, open the mmc service snap in. Double click on the service, look at the 'Service Name' tab. Try this instead, i.e "net stop SharedAccess" would be the Internet connnection sharing service.
0
 

Author Comment

by:Janrow
ID: 20352292
Excellent. That did it. Thanks to you both.  Pnkisthenewblue gets the majority of the points for the example and the more slimlined solution.

0
 
LVL 22

Expert Comment

by:Rick Hobbs
ID: 20354856
Glad I could be of help. Thanks.
0

Featured Post

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

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

Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
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 is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
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…

717 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