# Convert Exchange 2007 CCR Storage Group to # Circular Logging for Exchange migrations # Author: Andy Grogan # Version 1.0 # # # function modifyStorageGroupCopy($strSG,$Mode){ Suspend-StorageGroupCopy -Identity $strSG If($Mode -eq 1){ Set-StorageGroup -Identity $strSG -CircularLoggingEnabled $True }else{ Set-StorageGroup -Identity $strSG -CircularLoggingEnabled $False } $DB = Get-MailboxDatabase | Where {$_.StorageGroup -eq $strSG.Identity} Dismount-Database -Identity $DB for ($i = 1; $i -le 10; $i++) { write-progress -id 1 -activity "Preparing to Mount Database" -status "Working..." -percentComplete ($i*10); sleep 1; } Mount-Database -Identity $DB for ($i = 1; $i -le 10; $i++) { write-progress -id 1 -activity "Preparing to Re-Enable Storage Group Copy" -status "Working..." -percentComplete ($i*10); sleep 1; } Resume-StorageGroupCopy -Identity $strSG } $CCRServers = Get-MailboxServer | Where {$_.ClusteredStorageType -eq "NonShared"} $mbsCount = 0 Write-Host "*********************************************************************" Write-Host "* Exchange 2007 CCR Circular Logging Script" Write-Host "* Version 1.02" Write-Host "* Author: Andy Grogan" Write-Host "*" Write-Host "* This script can be used to prevent log file build up during large" Write-Host "* Mailbox Moves between servers" Write-Host "* " Write-Host "*" Write-Host "*********************************************************************" Write-Host "" Write-Host "WARNING - This Script enables circular logging on a given storage group." -ForegroundColor Red Write-Host "This will cause your database backups within the SG to not function." -ForegroundColor Red Write-Host "Remember to Disable CL when you have completed your moves - disable any" -ForegroundColor Red Write-Host "Backup jobs which will run when CL is enabled." -ForegroundColor Red Write-Host "" Write-Host "The Following CCR Cluster Servers have been found:" Write-Host "" Foreach ($cmbs in $CCRServers){ Write-Host "$mbsCount - $cmbs" $mbsCount ++ } Write-Host "" $ServerChoice = Read-Host "Please choose a CCR Cluster by its number from the list above" Write-Host "" If ($CCRServers.Count -eq $null){ $stgGroup = Get-StorageGroup -Server $CCRServers }else{ $stgGroup = Get-StorageGroup -Server $CCRServers[$ServerChoice] } $stgCount = 0 Foreach ($stg in $stgGroup){ Write-Host "$stgCount - $stg" $stgCount ++ } Write-Host "" $grpChoice = Read-Host "Please choose a storage group by its number from above" Write-Host "" Write-Host "Please choose an operational mode:" Write-Host "" Write-Host "1. Enable Circular Logging" Write-Host "2. Disable Circular Logging" Write-Host "" $ModeSwitch = Read-Host "Please make a mode choice" If ($stgGroup.Count -eq $null){ modifyStorageGroupCopy $stgGroup $ModeSwitch }else{ modifyStorageGroupCopy $stgGroup[$grpChoice] $ModeSwitch }