Solved

Batch files

Posted on 2009-05-09
2
335 Views
Last Modified: 2012-08-14
I am looking for batch file or script to check the Microsoft Exchange services automatically and restart  the services when services hung or stop work.

Please this case important
0
Comment
Question by:basamh
2 Comments
 
LVL 6

Accepted Solution

by:
jesusrulesme earned 125 total points
ID: 24344449
Exchange 2007:
net stop MSExchangeADTopology /y
net stop MSExchangeIS /y
net stop W3SVC /y

net start MSExchangeADTopology /y
net start MSExchangeIS /y
net start MSExchangeAntispamUpdate /y
net start MSExchangeEdgeSync /y
net start MSExchangeFDS /y
net start MSExchangeMailSubmission /y
net start MSExchangeMailboxAssistants /y
net start MSExchangeRepl /y
net start MSExchangeSearch /y
net start MSExchangeServiceHost /y
net start MSExchangeTransport /y
net start MSExchangeTransportLogSearch /y
net start W3SVC /y

Exchange 2003:
net stop msexchangesa /y
net start msexchangesa /y
net start msexchangemta /y
net start msexchangeis /y

The /y isn't necessary on all, but I usually put it just in case I've missed something.  The biggest thing is to learn to do these yourself so you can modify them as appropriate.  It is quite easy.  Just go to the services on the server (start, run, services.msc) and when you see a service, double click it.  Look for the service name, which is what you will need to put in the batch file for restarting services.  It is really just trial and error.  I've pasted in scripts I've used on a couple of different servers, but what you include depends on what services you are using (POP3, IMAP, etc).  
0
 

Author Closing Comment

by:basamh
ID: 31579757
this is the right solution
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

914 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

20 Experts available now in Live!

Get 1:1 Help Now