Hello, I do not know why this document was withdrawn. I provide the information as-is.
Automating Database Availability Group backups for Exchange 2010 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 Tivoli Storage Manager 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: Backup Scheme 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. backupdag.ps1--> #======================================================================# # # # IBM Tivoli Storage Manager for Mail # # # # Data Protection for Microsoft Exchange Server # # # # Script for backing up a DAG node - backupdag.ps1 # # # # 1. Check if server is a member of a DAG # # 2. Get list of databases on server and thier replication staus # # 3. Backup database if it meets one of the following: # # - Local Healthy passive database copy # # - Local Active copy where a healthy passive copy does not exist # # - Local Non replicated/recovery databases # # # # Usage: # # PowerShell backupdag.ps1 <log file path> # # # # Version: 1.0 # # # #======================================================================# # --- get server name --- $server = hostname $server = $server.ToUpper() $isDAG = $false $logFile = ".\backup.log" # --- write log entry --- function WriteOut { param($msg, $log) Write-Output((get-date -format 'yyyy-MM-dd hh:mm:ss') +" - " + $msg) Write-Output((get-date -format 'yyyy-MM-dd hh:mm:ss') +" - " + $msg) | out-file -encoding ASCII -filepath "$log" -append:$true } # --- check parameters --- if ($args) { $logFile = "$args" } WriteOut ("Server: " + $server) $logFile # --- is DP for Exchange installed? --- $versionInfo = Get-ItemProperty HKLM:\SOFTWARE\IBM\ADSM \CurrentVersion if (!$?) { WriteOut "DP for Exchange is not installed." $logFile exit 1 } # --- build full path to comand line --- $commandLine = $versionInfo.TSMExchangePath + "TDPExchange \tdpexcc.exe" # --- is this server a member of the DAG ? --- $members = Get-DatabaseAvailabilityGroup if ( $members ) { # --- look for server in DAG members --- foreach ( $member in $members.servers ) { if ( $member.Name.ToUpper().Contains($server) ) { $isDAG = $true break } } } if ( $isDAG ) { # --- get mailbox databases for server --- $databases = Get-MailboxDatabase -server $server -Status if ( $databases ) { WriteOut "Building database backup list..." $logFile # --- initialize database backup list ---- $backupList = "" # --- get replication type and copy status for each database --- foreach( $database in $databases ) { # --- setup state variables --- $healthyCopyExists = $false $localActiveCopy = $false # --- type "Remote" indicates remote replicated copy --- $type = $database.ReplicationType.ToString() if ( $type.CompareTo("Remote") -eq 0 ) { # --- get copy status for each database --- $statuses = Get-MailboxDatabaseCopyStatus $database.Name if ( $statuses ) { foreach( $status in $statuses ) { # --- look if a healthy copy exists --- if ( $status.Status.ToString().CompareTo("Healthy") -eq 0 ) { $healthyCopyExists = $true if ( $status.Name.Contains( $server ) ) { WriteOut ("==> Backing Up Healthy Passive Database Copy '$database'") $logFile $backupList += ('"' + $database + '"' + ',') } } elseif ( $status.Status.ToString().CompareTo ("Mounted") -eq 0 ) { # --- check for local active database copy --- if ( $status.Name.Contains( $server ) ) { $localActiveCopy = $true } } } # --- if a healthy copy does not exist, backup local active --- if ( (! $healthyCopyExists) -and ($localActiveCopy) ) { WriteOut ("==> Backing Up Active Database (No Healthy Copies Found) '$database'") $logFile $backupList += ('"' + $database + '"' + ',') } } } else # --- non replicated local database --- { # --- skip local recovery databases --- if ( ! $database.Recovery -and $database.Mounted ) { WriteOut ("==> Backing Up Non Replicated Database '$database'") $logFile $backupList += ('"' + $database + '"' + ',') } else { if ( $database.Recovery ) { WriteOut "==> Skipping Recovery Database '$database'" $logFile } else { WriteOut "==> Skipping Dismounted Non Replicated Database '$database'" $logFile } } } } if ( $backupList ) { WriteOut("Executing command: '" + $commandLine + "' BACKUP '" + $backupList + "' FULL /BACKUPMETHOD=VSS /BACKUPDESTINATION=TSM") $logFile & "$commandLine" BACKUP "$backupList" FULL /BACKUPMETHOD=VSS /BACKUPDESTINATION=TSM WriteOut "Backup completed." $logFile } else { WriteOut ("BACKUP LIST EMPTY" ) $logFile } } } else { WriteOut "This Server is NOT a member of a DAG" $logFile exit 1 } exit 0 -->backupdag.ps1 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. Example Output 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. Software Requirements http://www-01.ibm.com/support/docview.wss?&uid=swg21430691 Running the Sample Powershell Script from a Scheduler 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": (http://technet.microsoft.com/en-us/library/bb123798.aspx) 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: (http://www.ibm.com/support/docview.wss?uid=swg27018572) 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ "ADSM: Dist Stor Manager" <ADSM-L@VM.MARIST.EDU> wrote on 12/30/2014 11:20:47 AM: > From: "Stackwick, Stephen" <stephen.stackw...@icfi.com> > To: ADSM-L@VM.MARIST.EDU > Date: 12/30/2014 11:24 AM > Subject: [ADSM-L] Powershell script for Exchange DAG backup automation > Sent by: "ADSM: Dist Stor Manager" <ADSM-L@VM.MARIST.EDU> > > Del Hoobler recently mentioned a whitepaper with a sample Powershell > script to automate DAG backups. I can't seem to find it anymore and > a Google search for it yields a broken link, http://www-01.ibm.com/ > support/docview.wss?uid=swg21433016 > > Did IBM withdraw it for some reason? I'd like to get started trying > to load-balance our backups, but would like not to start from > scratch if possible. > > Steve > > STEPHEN STACKWICK | Senior Consultant | 301.518.6352 (m) | > stephen.stackw...@icfi.com<mailto:sstackw...@icfi.com> | icfi.com< > http://www.icfi.com/> > ICF INTERNATIONAL | 7125 Thomas Edison Dr, Suite 100, Columbia, Md > 21046 | 443-573-0524, 443-718-4900 (o) >