Please refer to the following steps on how to move user to different mailbox database using PowerShell Connecting to Exchange Remote PowerShell
$ExchangeURL = "http://mail.aventis.local/PowerShell/"
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri $ExchangeURL -Authentication Kerberos
Import-PSSession $Session
Check which mailbox database the user’s mailbox is located
get-mailbox -Identity m3test | Select Name, DisplayName, Database
Prepare a UserMailbox.csv file as below
m3test |
---|
m3test1 |
Please do not insert the Header as we are going to use Get-Content
Get the content of UserMailbox.csv and define $NewMailboxDB = "vEXDAG Standard"
$Path = "C:\TEMP\UserMailbox.csv"
$Users = Get-Content $Path
$NewMailboxDB = "vEXDAG_Standard"
foreach ($User in $Users) {
Get-Mailbox -Identity $User | New-MoveRequest -TargetDatabase $NewMailboxDB
}
Check the Move Request
#Check the progress of the move request
Get-MoveRequest
Get-MoveRequestStatistics -Identity m3test | fl
#Remove the Move Request
Get-MoveRequest | Remove-MoveRequest -Confirm:$false