Scripting for Windows Server Backup for Exchange 2010 RRS feed

  • Question

  • Hi,

    I'm new to writing scripts and was wondering if anyone could assist with writing a script to backup an Exchange Server in a windows 2008 r2 environment.  I currently use Windows Server Backup with a full VSS backup to run exchange backups, however, each backup overwrites the previous one, and i would really like to have multiple backups.  I would also like  to specify backup log locations, and have emails sent upon successful backups or failed backups.  I am trying to write this powershell but cant seem to get things to work.



    • Moved by Bill_Stewart Monday, June 30, 2014 5:29 PM Poor quality question/shows no research effort
    Sunday, February 9, 2014 6:49 AM

All replies

  • I think you would do much better posting questions about Exchange in the Exchange forum.

    Here is one exampke to get you started:



    Sunday, February 9, 2014 12:31 PM
  • You can use PowerShell in conjunction with the Windows Backup command line utility, wbadmin.exe. The code below should help get you started. I have included the date in order to help maintain multiple back ups, but if you do more than one back up per day, you will need to change the date format to include the time. You cannot control the built in logging of Windows Backup, but you could collect your own backup information and write that out to a text file. As far as sending emails, look into the Send-MailMessage cmdlet including the -Attachment parameter that could send your log file with your mail message. Cheers.

    $Date = Get-Date -Format 'MM-dd-yyyy'
    $Path = "\\server\share\$Date"
    New-Item -Path $Path -ItemType Directory | Out-Null
    Start-Process wbadmin.exe -ArgumentList "start backup -backupTarget:$Path -allCritical -vssFull -quiet"

    Monday, February 10, 2014 5:20 AM
  • This is what I was trying to avoid by sending the OP to the Exchange forum.  Exchange backups for other then the tiniest Exchange implementations require a much more complex approach to the backup including knowing what kind of logging is being done and how the logs need to be setup and rolled.

    Here are a series of articles that will explain the why and how of Exchange backup and why the simple approach will not work in most cases.

    The WBAdmin backup is mostly good for snapshotting a configuration.  The mail stores need to be handled in slightly different ways depending on the configuration.


    Monday, February 10, 2014 5:55 AM