当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 通过文本文件迁移 Exchange 邮箱

作者:精品下载站 日期:2024-12-14 18:07:15 浏览:15 分类:玩电脑

通过文本文件迁移 Exchange 邮箱


您想要将用户迁移到新的数据库或新的 Exchange Server。您可以使用 Exchange 管理中心 (EAC) 迁移邮箱并一一选择用户或使用 PowerShell。本文将向您展示如何使用 PowerShell 通过文本文件迁移 Exchange 邮箱。这样,您可以创建多个包含用户的文本文件,并将每个批次迁移到 Exchange 邮箱数据库。

配置文本文件

打开记事本并填写您要迁移的电子邮件地址。

[玩转系统] 通过文本文件迁移 Exchange 邮箱

将其另存为名为 migrate1.txt 的文本文件,并将其放置在 Exchange Server 上的以下路径 C:\migrate 中。如果您没有名为 migrate 的文件夹,请创建它。

[玩转系统] 通过文本文件迁移 Exchange 邮箱

您是否需要数据库或整个组织中所有邮箱的列表?查看文章使用 PowerShell 获取 Exchange 中所有用户的邮箱大小。

读取文本文件

以管理员身份运行 Exchange 命令行管理程序。将目录更改为迁移文件夹路径并读取文本文件。它将显示文本文件的内容。

[PS] C:\>cd "C:\migrate"

[PS] C:\migrate>Get-Content "migrate1.txt"
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

列出包含 count 个邮箱的数据库

在移动邮箱之前,最好验证目标邮箱数据库。运行以下命令列出组织中的数据库。

[PS] C:\migrate>Get-Mailbox -ResultSize Unlimited | Group-Object -Property:Database | Select-Object Name,Count | Sort-Object Name | Format-Table -Auto

Name      Count
----      -----
DB01         20
DB02         31
DB03         46
DB05         55
DB06         29

通过文本文件将邮箱迁移到特定数据库

假设您要将邮箱迁移到 DB03 数据库,请运行末尾带有 -WhatIf 参数的命令。 -WhatIf 参数允许您查看运行命令后会发生什么。不会进行任何更改。

[PS] C:\migrate>Get-Content "migrate1.txt" | New-MoveRequest -TargetDatabase "DB03" -WhatIf
What if: Creating move request "a-d.local/AT/Users/Standard/Doe01 John".
What if: Creating move request "a-d.local/AT/Users/Standard/Doe02 John".
What if: Creating move request "a-d.local/AT/Users/Standard/Doe03 John".
What if: Creating move request "a-d.local/AT/Users/Standard/Doe04 John".
What if: Creating move request "a-d.local/AT/Users/Standard/Doe05 John".
What if: Creating move request "a-d.local/AT/Users/Standard/Doe06 John".
What if: Creating move request "a-d.local/AT/Users/Standard/Doe07 John".
What if: Creating move request "a-d.local/AT/Users/Standard/Doe08 John".
What if: Creating move request "a-d.local/AT/Users/Standard/Doe09 John".
What if: Creating move request "a-d.local/AT/Users/Standard/Doe10 John".

运行不带 -WhatIf 参数的命令将邮箱迁移到数据库。

[PS] C:\migrate>Get-Content "migrate1.txt" | New-MoveRequest -TargetDatabase "DB03"

DisplayName StatusDetail        TotalMailboxSize               TotalArchiveSize PercentComplete
----------- ------------        ----------------               ---------------- ---------------
Doe01 John  WaitingForJobPickup 5.063 KB (5,184 bytes)                          0
Doe02 John  WaitingForJobPickup 2.423 MB (2,540,313 bytes)                      0
Doe03 John  WaitingForJobPickup 302.3 KB (309,603 bytes)                        0
Doe04 John  WaitingForJobPickup 4.377 MB (4,589,389 bytes)                      0
Doe05 John  WaitingForJobPickup 231.6 MB (242,877,775 bytes)                    0
Doe06 John  WaitingForJobPickup 3.148 GB (3,379,905,224 bytes)                  0
Doe07 John  WaitingForJobPickup 1.246 GB (1,337,894,754 bytes)                  0
Doe08 John  WaitingForJobPickup 5.301 GB (5,691,380,553 bytes)                  0
Doe09 John  WaitingForJobPickup 498.9 MB (523,091,486 bytes)                    0
Doe10 John  WaitingForJobPickup 5.32 GB (5,711,868,104 bytes)                   0

暂停迁移

如果要挂起(暂停)迁移,请使用 Suspend-MoveRequest cmdlet。

[PS] C:\migrate>Get-Content "migrate1.txt" | Suspend-MoveRequest

Confirm
Are you sure you want to perform this action?
Suspending move request "Doe01, John".  Suspending this move request will prevent data from being
replicated until it is manually resumed by using the Resume-MoveRequest cmdlet.
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [?] Help (default is "Y"): A

验证挂起状态

[PS] C:\migrate>Get-Content "migrate1.txt" | Get-MoveRequest | Get-MoveRequestStatistics

DisplayName StatusDetail TotalMailboxSize             TotalArchiveSize PercentComplete
----------- ------------ ----------------             ---------------- ---------------
Doe01 John  Suspend      5.063 KB (5,184 bytes)                        20
Doe02 John  Suspend      2.423 MB (2,540,313 bytes)                    15
Doe03 John  Suspend      302.3 KB (309,603 bytes)                      10
Doe04 John  Suspend      4.377 MB (4,589,389 bytes)                    10
Doe05 John  Suspend      231.6 MB (242,877,775 bytes)                  10
Doe06 John  Suspend      3.148 GB (3,379,905,224 bytes)                10
Doe07 John  Suspend      1.246 GB (1,337,894,754 bytes)                10
Doe08 John  Suspend      5.301 GB (5,691,380,553 bytes)                10
Doe09 John  Suspend      498.9 MB (523,091,486 bytes)                  10
Doe10 John  Suspend      5.32 GB (5,711,868,104 bytes)                 10

恢复迁移

当您想要恢复迁移时,请使用 Resume-MoveRequest cmdlet。

[PS] C:\migrate>Get-content "migrate1.txt" | Resume-MoveRequest

检查迁移状态

运行以下命令来检查迁移的状态。

[PS] C:\migrate>Get-Content "migrate1.txt" | Get-MoveRequest | Get-MoveRequestStatistics

DisplayName StatusDetail    TotalMailboxSize               TotalArchiveSize PercentComplete
----------- ------------    ----------------               ---------------- ---------------
Doe01 John  CopyingMessages 5.063 KB (5,184 bytes)                          23
Doe02 John  CopyingMessages 2.423 MB (2,540,313 bytes)                      22
Doe03 John  CopyingMessages 302.3 KB (309,603 bytes)                        45
Doe04 John  CopyingMessages 4.377 MB (4,589,389 bytes)                      31
Doe05 John  CopyingMessages 231.6 MB (242,877,775 bytes)                    84
Doe06 John  CopyingMessages 3.148 GB (3,379,905,224 bytes)                  73
Doe07 John  Completed       1.246 GB (1,337,894,754 bytes)                  100
Doe08 John  Completed       5.301 GB (5,691,380,553 bytes)                  100
Doe09 John  Completed       498.9 MB (523,091,486 bytes)                    100
Doe10 John  Completed       5.32 GB (5,711,868,104 bytes)                   100

您还可以检查文本文件中的电子邮件地址是否已迁移到目标数据库。

[PS] C:\migrate>Get-Content "migrate1.txt" | Get-Mailbox | Format-Table Name, Database

Name        Database
----        --------
Doe01 John  DB03
Doe02 John  DB03
Doe03 John  DB03
Doe04 John  DB03
Doe05 John  DB03
Doe06 John  DB03
Doe07 John  DB03
Doe08 John  DB03
Doe09 John  DB03
DOe10 John  DB03

邮箱已成功迁移到目标数据库。您是否将包含邮箱的文本批次迁移到 Exchange 中的数据库?

继续阅读:在 Exchange 中将邮箱列表导出为文本 »

结论

您了解了如何通过文本文件迁移 Exchange 邮箱。在 Exchange 中迁移带有文本文件的邮箱非常好。如果您需要迁移大量用户,准确的步骤和正确的方法至关重要。如果您可以在文本文件中批量处理邮箱并为每个批次选择一个目标数据库,则可以快速迁移。您还可以快速验证文本文件中的邮箱是否已迁移到目标数据库,这一点也很好。

您喜欢这篇文章吗?您可能还喜欢 Outlook 在迁移后不连接到 Exchange。不要忘记关注我们并分享这篇文章。

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯