Home > Microsoft Exchange Tips > Exchange Server Administration Tips > Sample batch file script to run NTBACKUP on Exchange
Exchange Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

EXCHANGE SERVER ADMINISTRATION TIPS

Sample batch file script to run NTBACKUP on Exchange


Serdar Yegulalp
08.02.2005
Rating: -4.07- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Backup solutions for Exchange abound, but there's one built right into Windows Server itself: command-line/GUI backup tool, NTBACKUP, which can be scripted with a batch file and made into a fairly powerful automated Exchange backup solution.

Here is a sample batch-file script to have NTBACKUP perform a full backup of the System State and Exchange information store. The script writes two backup files -- dirbackup.bkf (the directory services information) and exchbackup.bkf (the Exchange information store data) -- to the D: drive on the local machine (the location can be changed freely).

Because of possible conflicts, the two backups -- of directory services and the Exchange store -- should be performed separately.

You'll need to make a few changes to the script before it can run. <exchange_server> needs to be replaced with the name of your Exchange server, such as \\exch1.

This particular script also assumes that, when run, Exchange will be stopped for the sake of the backup operation --hence, the net stop commands. Consequently, the best time to run this backup operation should be at a time of low demand, like 4 a. m.

If you have the "Exchange-aware" version of NTBACKUP (i.e., the one included with all versions of Windows since Windows NT 4.0 SP3), and Exchange 2003 SP1 or later, it should be possible to run the backup cycle without the net stop and net start commands. However, experiment first to see if you can do this without logging errors.

Also, be mindful of failures in the logs, since a failed backup can create a condition where the Exchange store spontaneously dismounts, as outlined in Microsoft Knowledge Base article 812962.

If you want to back up to tape rather than a network drive, remove the /F option (and the corresponding filename) and replace it with /T "<name_of_tape >"...


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Exchange Server Administration Tips
Remove Exchange 2003 objects from AD to install Exchange 2010
Don'ts for optimal Exchange 2007 mailbox server efficiency
Is your Exchange 2007 hub transport server healthy?
Avoid Outlook 2007 performance issues during repairs
Developing an Exchange 2007 server role DR plan
How DSAccess service improves Exchange Server 2007 reliability
An introduction to the Exchange Remote Connectivity Analyzer tool
Monitor Exchange 2007 with disk- and RPC-related counters
DPM 2007 replica inconsistencies in Exchange databases
Track Exchange 2007 mailbox server health using database counters

Microsoft Exchange Server Backup and Disaster Recovery
Backing up public folders on multiple Exchange servers
Exchange Server 2010 bows with improved recovery
Restore Exchange storage groups with DPM 2007
How a hosted Exchange service can help you
Developing an Exchange 2007 server role DR plan
DPM 2007 replica inconsistencies in Exchange databases
Fixing DPM 2007 inconsistent replica errors in Exchange Server
New high availability features in Exchange Server 2010
Restore contacts from an Exchange public folder
Exchange Server 2007 SP2 reinstates built-in backup capabilities
Microsoft Exchange Server Backup and Disaster Recovery Research

Microsoft Exchange Server Administration Tools
An introduction to the Exchange Remote Connectivity Analyzer tool
Prevent Microsoft Outlook 2007 from hanging when forwarding email
Testing Unified Messaging connectivity in Exchange 2007
Microsoft Exchange Server 2007 performance tutorial
How to custom-configure a Microsoft Outlook 2007 install using OCT
Top Exchange Server performance monitoring and troubleshooting tools
Search and index Microsoft Outlook 2007 public folders
Executing an .MSP customization file in Microsoft Outlook 2007
Using the NTBackup tool for Exchange Server backup and recovery
Tools to bulk modify Active Directory users in Exchange Server 2003
Microsoft Exchange Server Administration Tools Research

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Remote Installation Service  (SearchExchange.com)
TCPMAN  (SearchExchange.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


-- where <name_of_tape> is of course the name of the tape to use (which must be added to the media pool and initialized beforehand).

About the author: Serdar Yegulalp is editor of the Windows Power Users Newsletter.

MEMBER FEEDBACK TO THIS TIP

Are there any batch files out there to run a scheduled System State backup on a Windows 2000/2003?
—Jim S.

******************************************

NTBACKUP lets you create a System State backup from the command line, so it would be pretty easy to create such a batch file:

ntbackup backup systemstate /F <filename>

(Use the /F switch to designate the backup file name, or the other command-line switches to designate the other media to use.)
—Serdar Yegulalp, tip author

******************************************

I want to back up only the individual mailboxes -- or certain mailboxes -- in Exchange 2003 using NTBACKUP. How can I do that?
—Linford G.

******************************************

There are many very good reasons why it's not a wise idea to try and back up individual mailboxes, also known in Exchange parlance as "brick-level backup." Aside from being terribly slow (especially if you have a lot of mail in a given set of folders), it also places the information store into an inconsistent state. Microsoft doesn't recommend doing it, and neither do I, and everyone I can think of who has attempted to swim upstream against this particular current has eventually been dragged under.

The main reason people want to do mailbox-level backups is so they can perform mailbox-level restores. Exchange 2003 provides a way to do this -- at least semi-elegantly -- using Recovery Storage Groups.

Your best bet is to devise a good global backup strategy instead of a potentially broken piecemeal one.
—Serdar Yegulalp, tip author

Do you have comments on this tip? Let us know.

Related information from SearchExchange.com:

  • Tip: NTBACKUP caveat for Exchange and system state backups
  • Expert Advice: Restoring an NTBACKUP file from one Exchange server to another
  • 20 tips in 20 minutes: Protecting and recovering Exchange 2003 data
  • Learning Center: The Exchange Server Backup and Recovery Toolbox
  • Learning Center: Toolbox for Exchange administrators
  • Reference Center: Exchange backup and recovery tips and resources

    Please let others know how useful this tip was via the rating scale below. Do you know a helpful Exchange Server, Microsoft Outlook or SharePoint tip, timesaver or workaround? Email the editors to talk about writing for SearchExchange.com.

    Rate this Tip
    To rate tips, you must be a member of SearchExchange.com.
    Register now to start rating these tips. Log in if you are already a member.


    Submit a Tip




    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



  • Email Server Solutions: Exchange 2007, Exchange 2003, Exchange 2000, SharePoint
    HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 2004 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts