Link to home
Start Free TrialLog in
Avatar of jkirman
jkirmanFlag for United States of America

asked on

Startup batch file for Exchange 2013

Greetings,

I have the following batch files in place for a client running Exchange 2013 on a Windows 2012 server, and would appreciate feedback on configuring a startup batch file for Exchange.  I would like to do this for the sake of testing shutdown configurations for the UPS monitoring software.  I have a shutdown batch file in place which is working fine.  I have searched for some authoritative document on what is the proper order to start up the services, but have only come across detailed sequences for other versions of Exchange.  Although it is straightforward enough to reboot the server, I would like to be able to bring Exchange back up via batch without a reboot.

Here is the order I currently have for starting services in the current Exchange startup batch file:

net start FMS
net start MSExchangeADTopology
net start MSExchangeDiagnostics
net start MSExchangeHM
net start HostControllerService
net start msexchangeIS
net start msexchangeServiceHost
net start msexchangeMailboxAssistant
net start msexchangeDelivery
net start msexchangeSubmission
net start msexchangeMailboxReplication
net start msexchangeTransport
net start msexchangeTransportLogSearch
net start msexchangeThrottling
net start msexchangeFrontEndTransport
net start msexchangeFastSearch
net start msexchangeRPC
net start msexchangeUM
net start msexchangeUMCR
net start msexchangeEdgeSync
net start msexchangeDAGMgmt
net start msexchangeRepl
net start msexchangeAntiSPAMUpdate
net start msexchangeIMAP4
net start msexchangeIMAP4BE

I am aware that some of these services, when started, will auto-start others.  Please advise on whether the order I have these services in is optimal or should be changed, and if I can use an abbreviated sequence, in which e.g. autostarting one service will end up starting several others.

For the sake of record, I am including the shutdown batch as well to complete the picture:

net stop msexchangeadtopology /y
net stop msexchangefba /y
net stop msftesql-exchange /y
net stop msexchangeis /y
net stop msexchangesa /y
net stop HostControllerService
net stop MSExchangeHM
net stop MSExchangeDiagnostics
net stop MSExchangeADTopology
net stop FMS


Thanks in advance for your comments and suggestions on this.
ASKER CERTIFIED SOLUTION
Avatar of LesterClayton
LesterClayton
Flag of Norway image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jian An Lim
I just want to call out about the UPS monitoring software.
If your exchange server and Dc are seperate server, you must shutdown your exchange server first, then your Active Directory server then.
Else, exchange server will not properly shutdown

I basically never need to run the stop services to shutdown the exchange server but if you really need it, yes, you just need to follow the above
May I ask why you are using this batch file?  Because startup batch files have not been around since Server 2000 almost 15 years ago.  This is the reason you have yet to find the "authoritative" document you've been looking for -- it doesn't exist because it's not something anyone needs.

Any decent UPS Monitoring software will shut down your server properly without the need at all to run a batch file to shut down services.  Windows and Exchange do this quite well all by themselves... all the UPS needs to do is to initiate a shutdown and the rest happens just fine.

Jeff
TechSoEasy
Avatar of jkirman

ASKER

Thank you Lester, I'll make us of the SC vs. net start commands going forward.

Agreed, Jian An Lim, I have been using that approach for almost 2 decades.  I have discussed this
point with Microsoft support on quite a number of occasions, and their advice is always the same - if you
want to shut down or restart an Exchange server, stop the Exchange services first.  This is especially critical for systems where Exchange is running on a domain controller.  Exchange running on a DC is of course not an optimal configuration, but for many smaller firms it may be the only option they have.  Either way, shutting down an Exchange server without stopping Exchange services first can cause the system to hang for a while, possibly hours, while the system tried to stop the Exchange services, and while the Exchange services are failing repeatedly while looking for DS.  I've used this approach for near 20 years and never had an Exchange server lock up or hang during a restart or a shutdown.  Typically I configure the UPS software to wait 2 minutes after a power outage for power to be restored.  If power is still down after 2 minutes, the software runs a batch or cmd file to stop the Exchange services.  The UPS software is configured to give the batch 3 to 4 minutes for Exchange shutdown, and after that it completes the server shutdown.  This has worked flawlessly for me for versions of Exchange since 5.5.

Jeffrey, the startup batch is basically a convenience to restart Exchange when testing during either installation or troubleshooting, and saving the time and steps vs. manually restarting services or rebooting the server.  With regards to Exchange shutdown, as per above, there are scores of articles in which MS and other top technical resources strongly recommend using a batch to shut down Exchange first before initiating a server shutdown to avoid a variety of issues.  APC and other UPS software vendors recommend this as well.  Over the years I have also recommended this to a number of administrators who were dealing with extended shutdown or restart times on their Exchange servers, and this has eliminated their issues entirely.

Many thanks to all for you input, suggestions and thoughts.  Cheers!