How to do I automate a backup scheme for database copies in an a Microsoft Exchange Server 2010 Database Availability Group (DAG) using IBM Tivoli Storage Manager for Mail : Data Protection for Microsoft Exchange Server ?
UPDATE: If you are using Data Protection for Exchange version 6.4 or later, there is enhanced support for Exchange Server Database Availability Group (DAG) environments. This includes the ability of the Exchange Servers to work cooperatively to balance the backup workload amongst the servers you choose as well as the ability to store all backups under a common TSM Server node (DAGNODE). For more information, refer to the Tivoli Storage Manager for Mail: Data Protection for Microsoft Exchange Server Installation and User's Guide under sections titled:
Continuous replication backups on Exchange Server --> Replication on Exchange Server 2010
Continuous replication backups on Exchange Server --> Database Availability Group backup best practices.
When performing backups in a Microsoft Exchange Server 2010 Database Availability Group (DAG) environment, it is recommended to perform the backups on the passive database copies. This helps reduce the resource impact on the production Exchange server when performing backup operations for your enterprise. However, there are instances where a passive database copy is not in a healthy state and the active database copy may need to be used for the backup.
The following sample Powershell script automates the backing up of the databases hosted on an Exchange 2010 server in a DAG environment. The script determines if the Exchange 2010 server is a member of a DAG and will back up its databases using the following scheme, consistent with best practices:
The sample Powershell script uses the following logic for backing up the Exchange 2010 server databases:
- Back up all local healthy passive database copies.
- Back up all local databases that are not replicated.
- Back up all local active database copies where a healthy passive copy is not available.
Note: This script is provided as an example and not eligible for support by IBM. The customer assumes responsibility for adopting, modifying, troubleshooting, or debugging, this script in their specific environment.
The sample Powershell script takes an optional parameter which is the path to a log file. If the parameter is not specified, logging will be directed to a file called ".\backup.log". The script output is sent to the log file as well as the console.
2010-06-08 02:45:35 - Server: MYSERVER
2010-06-08 02:45:38 - Building database backup list...
2010-06-08 02:45:38 - ==> Backing Up Non Replicated Database 'Mailbox Database 1'
2010-06-08 02:45:38 - ==> Backing Up Non Replicated Database 'Mailbox Database 2'
2010-06-08 02:45:38 - ==> Skipping Dismounted Non Replicated Database 'Test Mailbox Database'
2010-06-08 02:45:38 - ==> Backing Up Non Replicated Database 'Mailbox Database 3'
2010-06-08 02:45:38 - ==> Backing Up Healthy Passive Database Copy 'Mailbox Database 4'
2010-06-08 02:45:38 - ==> Backing Up Healthy Passive Database Copy 'Mailbox Database 5'
2010-06-08 02:45:38 - ==> Backing Up Active Database (No Healthy Copies Found) 'Mailbox Database 6'
2010-06-08 02:45:38 - Executing command: 'C:\Program Files\Tivoli\tsm\TDPExchange\tdpexcc.exe' BACKUP '"Mailbox Database 1","Mailbox Database 2","Test Mailbox Database","Mailbox Database 3","Mailbox Database 4","Mailbox Database 5","Mailbox Database 6" ' FULL /BACKUPMETHOD=VSS /BACKUPDESTINATION=TSM
2010-06-08 02:47:52 - Backup completed.
Running the Sample Powershell Script f rom a Schedule r
If you want to run the provided sample Powershell script on a scheduled basis using either the IBM Tivoli Storage Manager central scheduler or the Windows Task Scheduler service, follow these steps:
1. Create a .cmd or .bat command file to run the sample Powershell script.
2. Add the following statement to the command file to execute the sample Powershell script correctly:
PowerShell.exe -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; backupdag.ps1"
Note: For more information about launching Powershell scripts, please refer to the following Microsoft TechNet Library section titled "Scripting with the Exchange Management Shell":
3. Run the script either from the IBM Tivoli Storage Manager central scheduler as described in "Chapter
6. Using the Tivoli Storage Manager scheduler" of the IBM Tivoli Storage Manager for Mail: Data Protection for Microsoft Exchange Server Installation and User's Guide V6.1.2:
or from a Windows Scheduler Task.
Note : Running from a Windows Scheduler Task requires the following task security settings:
- Run as a domain administrator or other privileged user task (i.e. not a System Task)
- Run whether user is logged in or not.
- Run with highest privileges.