?
Solved

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

Posted on 2007-11-22
4
Medium Priority
?
219 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 600 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 1400 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

764 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