查询统计
查看迁移进度
Get-MoveRequest -MoveStatus inprogress | Get-MoveRequestStatistics | Sort-Object -Descending PercentComplete | ft displayname,statusdetail,percent*,sourcedatabase -AutoSize -Wrap
2010迁移2016进度:
$allmailbox=Get-Mailbox -ResultSize Unlimited
$迁移进度=$($allmailbox |?{$.AdminDisplayVersion -like "15.1"}|Measure-object).Count/$allmailbox.Count
$迁移进度="{0:P2}" -f $迁移进度
Echo "迁移进度:$迁移进度,已完成人数:$($($allmailbox |?{$.AdminDisplayVersion -like "15.1"}|Measure-object).Count)人,总数:$($allmailbox.Count)人"
整库迁移
Get-Mailbox -Database 源库 |New-MoveRequest -TargetDatabase 目标库 -BadItemLimit 500 -AcceptLargeDataLoss -Debug -Verbose -SkipMoving:folderviews,folderrestrictions
导出用户(用于统计用户配额是否满足迁移需求 与 用户迁移通告)
$dataname="目标库"
Get-Mailbox -Database $dataname |select Name,Alias,ProhibitSendReceiveQuota,PrimarySmtpAddress |Export-Csv -Path D:\迁移用户\aaaa\$dataname.csv -NoTypeInformation -Encoding UTF8
过滤绝大部分失败命令:
$users=Import-Csv D:\迁移用户\aaaa\DatabaseUser.csv -Encoding Default
foreach($user in $users){
get-mailbox -id $user.Alias |New-MoveRequest -TargetDatabase Other-System-SSD901-02 -BadItemLimit 500 -AcceptLargeDataLoss -Debug -Verbose -SkipMoving:folderviews,folderrestrictions
}
注:DatabaseUser.csv为导出的文件
查看失败错误信息
Get-MoveRequest |?{$.Status -like "Failed"}|Get-MoveRequestStatistics|select Alias,Message
Get-MoveRequest |?{$.Status -like "Failed"}|Get-MoveRequestStatistics|fl Alias,RequestQueue,Message
查看配额失败列表信息
$moverequest=Get-MoveRequest |?{$.Status -like "Failed"}|Get-MoveRequestStatistics|select Alias,Message
$mrequests=@()
Foreach($mrequest in $moverequest){
$size=@()
$size=$mrequest.Message -split "Size: '"
$size =$size[1].Split("(")[0]
$quota=@()
$quota=$mrequest.Message -split "Quota: '"
$quota=$quota[1].Split("(")[0]
If($size)
$mrequests+=$mrequest|select Alias,@{Name = 'size'; Expression = {$size}},@{Name = 'quota'; Expression = {$quota}}
}
$mrequests
处理失败项目的重新迁移命令
$user=@()
$failedusers=Get-MoveRequest |?{$.Status -like "Failed"}
Foreach($user in $failedusers){
Remove-MoveRequest $user.DisplayName -Confirm:$false
set-mailbox -id $user.Alias -RecoverableItemsQuota 30GB
New-MoveRequest -Identity $user.DisplayName -SkipMoving:folderviews,folderrestrictions -TargetDatabase $user.TargetDatabase -BadItemLimit 500 -AcceptLargeDataLoss -Debug -Verbose
}
手动单独处理失败用户迁移
Remove-MoveRequest -Identity username
New-MoveRequest -Identity username -SkipMoving:folderviews,folderrestrictions -TargetDatabase 目标库 -BadItemLimit 500 -AcceptLargeDataLoss -Debug -Verbose
删除已完成的请求
Get-MoveRequest |?{$_.Status -like "Completed"}|Remove-MoveRequest -Confirm:$false
注意:
迁移请记得迁移系统邮箱、公用文件夹。
邮箱疑难问题处理:
https://docs.microsoft.com/zh-cn/previous-versions/office/exchange-server-2010/dd638094(v=exchg.141)