Sample Batch Files for Offline Backup

The following are sample batch files you can use for backing up your files when the server is offline. You may need to experiment with the order in which you stop the services, so that you are not prompted when a service is dependent upon the one you are stopping. Example 1

rem ** Stop Microsoft Exchange services.
rem ** You can stop Microsoft Exchange services and restart them
automatically to backup.
rem ** Files that a particular service may hold open

REM // stop all services
echo Stopping Services...
net stop MSExchangeMSMI
net stop MSExchangePCMTA
net stop MSExchangeFB
net stop MSExchangeDX
net stop MSExchangeIMC
net stop MSExchangeMTA
net stop MSExchangeIS
net stop MSExchangeDS
net stop MSExchangeSA
ntbackup backup c:\ d:\ /a /v /d "Full File Based Backup" /b /l
c:\winnt\backup.log /e
REM edbutil OPTIONS
net start MSExchangeSA
net start MSExchangeDS
net start MSExchangeIS
net start MSExchangeMTA
net start MSExchangeIMC
net start MSExchangeDX
net start MSExchangeFB
net start MSExchangePCMTA
net start MSExchangeMSMI
Example 2

You can start and stop Microsoft Mail (PC) MTA (PCMTA) services by enclosing the service name in quotation marks. You can determine the service names from the Microsoft Exchange Server Administrator program or Windows NT Control Panel, or by viewing the Windows NT registry.

If you are viewing the Windows NT Registry, open the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

All services are listed in alphabetical order.

rem Batch File To Stop and Restart Microsoft Exchange Services
rem For File Based Backup
echo Stopping Services ...
net stop MSExchangeMSMI
net stop MSExchangePCMTA
net stop MSExchangeFB
net stop MSExchangeDX
net stop MSExchangeMTA
net stop MSExchangeIMC
net stop MSExchangeIS
net stop MSExchangeDS

net stop "PC MTA - HUB"
net stop MSExchangeSA

ntbackup BACKUP d:\exchsrvr\mdbdata /v /d "File Based Backup" /b /l
c:\winnt\backup.log /e
net start MSExchangeSA
net start MSExchangeDS
net start MSExchangeIS
net start MSExchangeMTA
net start MSExchangeIMC
net start MSExchangeDX
net start MSExchangeFB
net start MSExchangePCMTA
net start MSExchangeMSMI
net start "PC MTA - HUB"