Solved

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

Posted on 2007-11-22
4
214 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
  • 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Organizations create, modify, and maintain huge amounts of data to help their businesses earn money and generally function.  Typically every network user within an organization has a bit of disk space to store in process items and personal files.   …
by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

813 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now