First we will start with mailbox movement for single user
001
|
Get-mailbox -Identity viviana
|
Before move request, you can validate if you want to know what is actually going to happen by using -whatif cmdlet — & use the above important parameters which may required in your production environment.
001
|
New-MoveRequest –identity viviana –TargetDatabase MDB02 -whatif
|
001
|
New-MoveRequest –identity viviana –TargetDatabase MDB02
|
We can suspend or remove the move request – If you suspend the move request, that can be resumed, but removed move request can’t be resumed back.
001
002 |
Suspend-MoveRequest -Identity viviana
Remove-MoveRequest -Identity viviana |
001
002 003 004 |
Get-MoveRequest
#—– We can also select particular properties as showing below Get-MoveRequest | select DisplayName,Alias,Status,TargetDatabase,percentcomplete Get-MoveRequestStatistics -Identity viviana |
001
|
Resume-MoveRequest -Identity viviana
|
As per the above examples, we are just migrating a single user – But in production we need to migrate thousands of users –
As per the below script, we are just directly moving mailboxes – We can use the below important parameters as well.
-SuspendWhenReadyToComplete
-BadItemLimit
001
002 003 004 005 |
$csvinput = Import-Csv -Path ‘C:ProjectInput.csv’
Foreach ($csv in $csvinput) { New-MoveRequest –identity ($csv.alias) –TargetDatabase ($csv.database) -BatchName “TESTMove01” } |
If we are moving mailboxes to the same Database, mention only Alias in CSV file and use the below script — You need to type the database name manually in this case.
Note : We can use notepad as well if we are importing only user details – Replace Import-Csv with Get-Content cmdlet
001
002 003 004 005 |
$csvinput = Import-Csv -Path ‘C:ProjectInput.csv’
Foreach ($csv in $csvinput) { New-MoveRequest –identity ($csv.alias) –TargetDatabase “MDB01” -BatchName “TESTMove01” } |
Move request status
1 2 3 4 5 6 7 8 9 |
Get-MoveRequest -BatchName "MDB01" #-- Grid View with selected properties Get-MoveRequest -BatchName "MDB01" | select DisplayName,Alias,Status,TargetDatabase,percentcomplete | Out-GridView # we can use the below cmdlet as well Get-MoveRequestStatistics -BatchName “MDB01” | select DisplayName,Alias,Status,TargetDatabase,percentcomplete | Out-GridView |
Move request status summary
001
|
Get-MoveRequest -BatchName “MDB01” | group status -noelement
|
Export your status report
001
002 |
Get-MoveRequest -BatchName “MDB01” |select DisplayName,Alias,Status,TargetDatabase,percentcomplete |
Export-Csv -Path “C:ReportOutputt.csv” -NoTypeInformation |
It is actually a great and helpful piece of information. I am happy that you
just shared this helpful information with us. Please keep us informed like this.
Thank you for sharing.