#MsExchange #Powershell
Sometimes you get databases in a DAG with an Initializing or Resynchronizing state. The way I have found to fix this is to Suspend the database copy and then resume it.
If you have quite a few databases its a pain in the butt using the console to do this .. so I wrote this. You have to run it on the server that has a copy in either Initializing or Resynchronizing state.
########################################################################################## #Load the Exchange 2010 bits & bobs ######################################################################################### $xPsCheck = Get-PSSnapin | Select Name | Where {$_.Name -Like "*Exchange*"} If ($xPsCheck -eq $Null) {Write-Host "Loading Exchange Snapin"; Add-PsSnapin Microsoft.Exchange.Management.PowerShell.e2010} $gmdcs = Get-MailboxDatabaseCopyStatus ForEach($item in $gmdcs){ $tmpstatus = $item.Status $tmpName = $item.Name Write-Host $tmpName "["$tmpStatus"]" IF (($tmpStatus -eq "Resynchronizing") -OR ($tmpStatus -eq "Initializing")){ Write-Host "- Suspending" suspend-MailboxDatabaseCopy -Identity $tmpName -Confirm:$False Write-Host "- Resuming" resume-MailboxDatabaseCopy -Identity $tmpName } }