Exchange 2010 – Move All Mailboxes From OU To Specific Database
I needed to move all mailboxes for accounts in a specific OU to a specific Mailbox Database. Below are the powershell commands I used to accomplish this.
To create the necessary move requests:
$ou = "constoso.com/account purgatory" Get-Mailbox -OrganizationalUnit $ou | New-MoveRequest -TargetDatabase "Purgatory"
To clean up the move requests when complete:
Get-MoveRequest | Where-Object { $_.Identity -like "$ou*" -and $_.Status -eq "Completed" } | Remove-MoveRequest -Confirm:$false