Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stopping Exchange services using scheduler 1

Status
Not open for further replies.

delski

MIS
Sep 3, 2003
14
IE
I would like to stop the exchange services on one of our exchange servers to perform a flat file backup of the entire server over the weekend. I would like to setup an "SC" command in scheduler to stop the mail services before the backup kicks in. I have the syntax for the command as follows

sc \\server stop "service name"

I would like to know what the "microsoft excahnge system attendant service" is called and if anyone has don't something similar or has any views I would be very happy to hear then....

Thanks
 
Here's the script we use which we schedule via the at command.

echo off

echo.
echo.Stopping the Exchange services...
echo.

net stop "Microsoft Exchange Internet Mail Service"
net stop "Microsoft Exchange Event Service"
net stop "Microsoft Exchange Information Store"
net stop "Microsoft Exchange Message Transfer Agent"
net stop "Microsoft Exchange Directory"
net stop "Microsoft Exchange System Attendant"


Exit

-------------------------------

If it doesn't leak oil it must be empty!!
 
HI.

I've written it some time ago.
You would also like to add logging capabilities and notifications so you can track the process.
You can send email notifications before and after the operation using BLAT, MAILIT, or any other utility.

The file EXCHANCE.CMD is part of my NUTS collection here:
Or here (exchance.cmd/exchance.zip):

Here is my basic script:

REM EXCHANCE.CMD Ver 1.21 - Exchange server offline backup.
REM *** YOU SHOULD MANUALLY EDIT AND DEBUG THIS FILE AS NEEDED ! ***
REM * Add NET STOP/START commands for other services if needed ! *

SET EXLOG=EXCHANCE.LOG
ECHO. >>%EXLOG%
ECHO --------------------------------- >>%EXLOG%
ECHO STARTING EXCHANCE >>%EXLOG%
DATE /T >>%EXLOG%

ECHO STOPPING SERVICES ...
ECHO STOPPING SERVICES at ...>>%EXLOG% & TIME /T >>%EXLOG%
REM - NET STOP NavExchange /YES
REM - NET STOP MSExchangeINS /YES
REM - NET STOP MSExchangeDXA /YES
NET STOP MSExchangeIMC /YES
NET STOP MSExchangeES /YES
NET STOP MSExchangeMTA /YES
NET STOP MSExchangeIS /YES
NET STOP MSExchangeDS /YES
NET STOP MSExchangeSA /YES

REM * This will create an offline backup of Exchange server:

REM * Add similar lines for each drive with an EXCHSRVR folder !!!
REM * You may change target folder as needed.
REM * Warning: ROBOCOPY Deletes files from the target folder ! *

ECHO COPYING FILES ...
ECHO COPYING FILES started at ...>>%EXLOG% & TIME /T >>%EXLOG%

ROBOCOPY C:\EXCHSRVR BACK-C\EXCHSRVR /MIR /R:0

REM * ROBOCOPY is part of the NT Resource Kit from Microsoft.
REM * If you don't have ROBOCOPY, use for each drive:
REM xcopy C:\EXCHSRVR BACK-C\EXCHSRVR /C/D/E/H/I/K/R
REM * However, xcopy will not delete obsolete (unnedded) files.

ECHO STARTING SERVICES ...
ECHO STARTING SERVICES at ...>>%EXLOG% & TIME /T >>%EXLOG%
NET START MSExchangeSA
NET START MSExchangeDS
NET START MSExchangeIS
NET START MSExchangeMTA
NET START MSExchangeES
NET START MSExchangeIMC
REM - NET START MSExchangeDXA
REM - NET START MSExchangeINS
REM - NET START NavExchange

REM * It is a good idea to backup the registry as well,
REM using REGBACK (from NT4ResKit) or RDISK /S .

ECHO DONE.
ECHO END OF EXCHANCE at ...>>%EXLOG%
TIME /T>>%EXLOG% & DATE /T>>%EXLOG%



Yizhar Hurwitz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top