Tuesday, 6 March 2012

PowerShell Scripts used in exchange Migration

We've been recently migrating users from an Exchange 2003 environment to Exchange 2010 SP2. We have been using powershell for the most of it along with Opalis. Here are some command's we found useful.

Resume any suspended move requests.
Get-MoveRequest -MoveStatus Suspended | Resume-MoveRequest -confirm:$false

Delete any completed move requests
Get-MoveRequest -MoveStatus Completed | Remove-MoveRequest -confirm:$false

Create a new move request (We used this for any mop ups we had to do due to incorrect email addresses fed into our Opalis workflow)
New-MoveRequest -Identity <username> -BadItemLimit 50 -Suspend:$true

If we didn't want a database to be included in the automatic distribution of mailboxes we ran this command
Set-MailboxDatabase DB01 -IssuspendedFromProvisioning $True

To get the status of our databases after a migration. We didn't want to include the archive databases so we filtered them out.
get-mailboxdatabase -status | select servername,name,databasesize | where {$_.name -notlike "*Arch*"}

And lastly to get the number of mailboxes per database we run the following script

(Get-MailboxDatabase) | where {$_.name -notlike "*Arch*"} | ForEach-Object {Write-Host $_.Name (Get-Mailbox -Database $_.Name).Count}

1 comment:

  1. nice post, it was a great read, thanks for going to the effort of publishing it .Exchange Migration

    ReplyDelete