使用批处理迁移将旧版公用文件夹迁移到 Office 365 和 Exchange OnlineUse batch migration to migrate legacy public folders to Office 365 and Exchange Online

摘要: 使用这些过程将 Exchange 2010 公用文件夹移动到 Office 365。Summary: Use these procedures to move your Exchange 2010 public folders to Office 365.

本主题介绍如何将您在直接转换或暂存迁移的公用文件夹从更新汇总 8 迁移的 Exchange Server 2010 Service Pack 3 (SP3),到 Office 365 或 Exchange Online。This topic describes how to migrate your public folders in a cutover or staged migration from Update Rollup 8 for Exchange Server 2010 Service Pack 3 (SP3) to Office 365 or Exchange Online.

本主题将 Exchange 2010 SP3 RU8 服务器称为旧版 Exchange 服务器。另外,本主题中的步骤适用于 Exchange Online 和 Office 365。本主题中,可以交替使用术语。This topic refers to the Exchange 2010 SP3 RU8 server as the legacy Exchange server. Also, the steps in this topic apply to both Exchange Online and Office 365. The terms may be used interchangeably in this topic.

备注

本文中描述的批处理迁移方法是将旧版公用文件夹迁移到 Office 365 和 Exchange Online 唯一受支持的方法。由 Microsoft 不再支持公用文件夹迁移的旧串行迁移方法。The batch migration method described in this article is the only supported method for migrating legacy public folders to Office 365 and Exchange Online. The old serial migration method for migrating public folders is no longer supported by Microsoft.

我们建议您不要使用 Outlook 的 PST 导出功能将公用文件夹迁移到 Office 365 或 Exchange Online。Office 365 和 Exchange Online 公用文件夹邮箱增长使用自动拆分功能进行管理,此功能可在公用文件夹邮箱超过大小配额时对其进行拆分。当您使用 PST 导出功能迁移公用文件夹时,自动拆分无法应对公用文件夹邮箱的突然增长,您可能必须至少等待两星期,自动拆分才会将数据从主邮箱中移出。我们建议您使用本文档中基于 cmdlet 的说明将公用文件夹迁移到 Office 365 和 Exchange Online。但是,如果您选择使用 PST 导出迁移公用文件夹,请参阅本主题后面的使用 Outlook PST 导出将公用文件夹迁移至 Office 365部分。We recommend that you don't use Outlook's PST export feature to migrate public folders to Office 365 or Exchange Online. Office 365 and Exchange online public folder mailbox growth is managed using an auto-split feature that splits the public folder mailbox when it exceeds size quotas. Auto-split can't handle the sudden growth of public folder mailboxes when you use PST export to migrate your public folders and you may have to wait for up to two weeks for auto-split to move the data from the primary mailbox. We recommend that you use the cmdlet-based instructions in this document to migrate public folders to Office 365 and Exchange Online. However, if you elect to migrate public folders using PST export, see the section Migrate Public Folders to Office 365 by using Outlook PST export later in this topic.

将使用 *-MigrationBatch cmdlet 以及以下 PowerShell 脚本来执行迁移:You'll perform the migration using the *-MigrationBatch cmdlets, in addition to the following PowerShell scripts:

  • Export-PublicFolderStatistics.ps1 此脚本将创建文件夹名称到文件夹大小的映射文件。将在旧版 Exchange 服务器上运行此脚本。Export-PublicFolderStatistics.ps1 This script creates the folder name-to-folder size mapping file. You'll run this script on the legacy Exchange server.

  • Export-PublicFolderStatistics.psd1 此支持文件由 Export-PublicFolderStatistics.ps1 脚本使用,并且应该下载到同一位置。Export-PublicFolderStatistics.psd1 This support file is used by the Export-PublicFolderStatistics.ps1 script and should be downloaded to the same location.

  • PublicFolderToMailboxMapGenerator.ps1 此脚本使用 Export-PublicFolderStatistics.ps1 脚本的输出创建公用文件夹到邮箱的映射文件。将在旧版 Exchange 服务器上运行此脚本。PublicFolderToMailboxMapGenerator.ps1 This script creates the public folder-to-mailbox mapping file by using the output from the Export-PublicFolderStatistics.ps1 script. You'll run this script on the legacy Exchange server.

  • PublicFolderToMailboxMapGenerator.strings.psd1 此支持文件由 PublicFolderToMailboxMapGenerator.ps1 脚本使用,并且应该下载到同一位置。PublicFolderToMailboxMapGenerator.strings.psd1 This support file is used by the PublicFolderToMailboxMapGenerator.ps1 script and should be downloaded to the same location.

  • Create-PublicFolderMailboxesForMigration.ps1 该脚本创建用于迁移的目标公用文件夹邮箱。此外,此脚本依据 Limits for Public Folders中建议的每个公用文件夹邮箱上用户登录次数的准则,计算用于处理估计的用户负载所需要的邮箱数。Create-PublicFolderMailboxesForMigration.ps1 This script creates the target public folder mailboxes for the migration. In addition, this script calculates the number of mailboxes necessary to handle the estimated user load, based on the guidelines for the number of user logons per public folder mailbox recommended in Limits for Public Folders.

  • Create-PublicFolderMailboxesForMigration.strings.psd1 此支持文件供 Create-PublicFolderMailboxesForMigration.ps1 脚本使用,应下载到相同的位置。Create-PublicFolderMailboxesForMigration.strings.psd1 This support file is used by the Create-PublicFolderMailboxesForMigration.ps1 script and should be downloaded to the same location.

  • Sync-MailPublicFolders.ps1 此脚本在您的本地 Exchange 部署和 Office 365 之间同步已启用邮件的公用文件夹对象。将在旧版 Exchange 服务器上运行此脚本。Sync-MailPublicFolders.ps1 This script synchronizes mail-enabled public folder objects between your local Exchange deployment and Office 365. You'll run this script on the legacy Exchange server.

  • SyncMailPublicFolders.strings.psd1 这是由 Sync-MailPublicFolders.ps1 脚本使用的支持文件,并且应当将其复制至与上述脚本相同的位置。SyncMailPublicFolders.strings.psd1 This is a support file used by the Sync-MailPublicFolders.ps1 script and should be copied to the same location as the preceding scripts.

第 1 步:下载迁移脚本详细介绍了从何处可以下载这些脚本。请确保所有脚本都下载到相同的位置。Step 1: Download the migration scripts provides details about where to download these scripts. Make sure all scripts are downloaded to the same location.

有关与公用文件夹相关的其他管理任务,请参阅Public Folder ProceduresFor additional management tasks related to public folders, see Public Folder Procedures.

将公用文件夹迁移到 Office 365 和 Exchange Online 的操作支持哪些 Exchange 版本?What versions of Exchange are supported for migrating public folders to Office 365 and Exchange Online?

Exchange 支持将您的公用文件夹从以下旧版 Exchange Server 移动至 Office 365 和 Exchange Online:Exchange supports moving your public folders to Office 365 and Exchange Online from the following legacy versions of Exchange Server:

  • Exchange 2010 SP3 RU8 或更高版本Exchange 2010 SP3 RU8 or later

如果您需要将您的公用文件夹移动到 Exchange Online,但您的本地服务器未运行的最小的支持版本的 Exchange 2010,我们强烈建议您升级您的内部服务器和使用批处理迁移,这是唯一受支持公用文件夹迁移方法。If you need to move your public folders to Exchange Online but your on-premises servers aren't running the minimum support versions of Exchange 2010, we strongly recommend that you upgrade your on-premises servers and use batch migration, which is the only supported public folder migration method.

不能直接从 Exchange 2003 迁移公用文件夹。如果您在运行 Exchange 2003 组织中,您需要移动的所有公用文件夹数据库和副本到 Exchange 2010 SP3 RU8 或更高版本。任何公用文件夹副本可以在 Exchange 2003 上不保留。此外,不能通过 Exchange 2003 服务器路由邮件发送到 Exchange 2013 公用文件夹。You can't migrate public folders directly from Exchange 2003. If you're running Exchange 2003 in your organization, you need to move all public folder databases and replicas to Exchange 2010 SP3 RU8 or later. No public folder replicas can remain on Exchange 2003. Additionally, mail destined for an Exchange 2013 public folder can't be routed through an Exchange 2003 server.

在开始之前,您需要知道什么?What do you need to know before you begin?

  • Exchange 2010 服务器需要运行 Exchange 2010 SP3 RU8 或更高版本。The Exchange 2010 server needs to be running Exchange 2010 SP3 RU8 or later.

  • 在 Office 365 和 Exchange Online 中,您必须是"组织管理"角色组的成员。该角色组与订阅 Office 365 或 Exchange Online 时分配给您的权限不同。有关如何启用"组织管理"角色组的详细信息,请参阅Manage Role GroupsIn Office 365 and Exchange Online, you need to be a member of the Organization Management role group. This role group is different from the permissions assigned to you when you subscribe to Office 365 or Exchange Online. For details about how to enable the Organization Management role group, see Manage Role Groups.

  • 在 Exchange 2010 中,必须是组织管理或服务器管理 RBAC 角色组的成员。有关详细信息,请参阅向角色组添加成员In Exchange 2010, you need to be a member of the Organization Management or Server Management RBAC role groups. For details, see Add Members to a Role Group.

  • 迁移之前,如果组织中有任何公用文件夹大于 2 GB,我们建议删除该文件夹的内容或者将其拆分为多个公用文件夹。如果这两个选项都不可行,我们建议您不要将公用文件夹移动到 Office 365 和 Exchange Online。Before migration, if any public folder in your organization is greater than 2 GB, we recommend either deleting content from that folder or splitting it up into multiple public folders. If either of these options isn't feasible, we recommend that you do not move your public folders to Office 365 and Exchange Online.

  • 在 Office 365 和 Exchange Online 中,可以创建最多 1,000 个公用文件夹邮箱。In Office 365 and Exchange Online, you can create a maximum of 1,000 public folder mailboxes.

  • 在迁移公用文件夹之前,我们建议先将所有用户邮箱移动到 Office 365 和 Exchange Online。有关详细信息,请参阅将多个电子邮件帐户迁移到 Office 365 的方法Before you migrate your public folders, we recommend that you first move all user mailboxes to Office 365 and Exchange Online. For details, see Ways to migrate multiple email accounts to Office 365.

  • Outlook 无处不需要在旧版 Exchange 服务器上启用。有关在 Exchange 2010 服务器上启用 Outlook Anywhere 的详细信息,请参阅启用 Outlook AnywhereOutlook Anywhere needs to be enabled on the legacy Exchange server. For details about enabling Outlook Anywhere on Exchange 2010 servers, see Enable Outlook Anywhere.

  • 不能使用 Exchange 管理中心 (EAC) 或 Exchange 管理控制台 (EMC) 执行此过程。在旧版 Exchange 服务器上,需要使用 Exchange 命令行管理程序。对于 Exchange Online,需要使用 Exchange Online PowerShell。有关详细信息,请参阅使用远程 PowerShell 连接到 Exchange OnlineYou can't use the Exchange admin center (EAC) or the Exchange Management Console (EMC) to perform this procedure. On the legacy Exchange servers, you need to use the Exchange Management Shell. For Exchange Online, you need to use Exchange Online PowerShell. For more information, see Connect to Exchange Online Using Remote PowerShell.

  • 您必须使用单个迁移批次迁移所有公用文件夹数据。Exchange 允许创建一次只有一个迁移批处理。如果您试图同时创建多个迁移批次,结果将是个错误。You must use a single migration batch to migrate all of your public folder data. Exchange allows creating only one migration batch at a time. If you attempt to create more than one migration batch simultaneously, the result will be an error.

  • 在开始之前,我们建议您完整阅读本主题,因为有些步骤需要停机时间。Before you begin, we recommend that you read this topic in its entirety as downtime is required for some steps.

  • 若要了解可能适用于此主题中过程的键盘快捷键,请参阅 Exchange 管理中心内的键盘快捷键For information about keyboard shortcuts that may apply to the procedures in this topic, see Keyboard shortcuts in the Exchange admin center.

提示

遇到问题了吗?请在 Exchange 论坛中寻求帮助。 请访问以下论坛:Exchange ServerExchange OnlineExchange Online ProtectionHaving problems? Ask for help in the Exchange forums. Visit the forums at Exchange Server,Exchange Online, or Exchange Online Protection.

您该如何做?How do you do this?

第 1 步:下载迁移脚本Step 1: Download the migration scripts

  1. Public Folders Migration Scripts(公用文件夹迁移脚本)下载所有的脚本和支持文件。Download all scripts and supporting files from Public Folders Migration Scripts.

  2. 将脚本保存到将运行 PowerShell 的本地电脑。例如,C:\PFScripts。请确保所有的脚本都保存在相同的位置。Save the scripts to the local computer on which you'll be running PowerShell. For example, C:\PFScripts. Make sure all scripts are saved in the same location.

  3. Mail-enabled Public Folders - directory sync script(启用邮件的公用文件夹 - 目录同步脚本)下载以下文件:Download the following files from Mail-enabled Public Folders - directory sync script:

    • Sync-MailPublicFolders.ps1

    • SyncMailPublicFolders.strings.psd1

  4. 将脚本保存到与步骤 2 操作相同的位置。例如,C:\PFScripts。Save the scripts to the same location you did for step 2. For example, C:\PFScripts.

步骤 2:准备迁移Step 2: Prepare for the migration

在开始迁移之前,执行以下先决条件步骤。Perform the following prerequisite steps before you begin the migration.

一般先决条件步骤General prerequisite steps

  • 请确保 Active Directory 中没有孤立的公用文件夹邮件对象,表示 Active Directory 中的对象没有对应的 Exchange 对象。Make sure that there are no orphaned public folder mail objects in Active Directory, meaning objects in Active Directory without a corresponding Exchange object.

  • 确认为 Active Directory 中的公用文件夹配置的 SMTP 电子邮件地址与 Exchange 对象上的 SMTP 电子邮件地址匹配。Confirm that SMTP email address configured for public folders in Active Directory match the SMTP email addresses on the Exchange objects.

  • 请确保 Active Directory 中没有重复的公用文件夹对象,以避免两个或多个 Active Directory 对象 指向相同的启用邮件的公用文件夹这种情况。Make sure that there are no duplicate public folder objects in Active Directory, to avoid a situation where two or more Active Directory objects are pointing to the same mail-enabled public folder.

    旧版 Exchange 服务器上的先决条件步骤Prerequisite steps on the legacy Exchange server

  1. 在旧版 Exchange 服务器上,确保可继续正常路由到将存在于 Office 365 或 Exchange Online 中的已启用邮件的公用文件夹,直到所有通过 Internet 的 DNS 缓存更新到指向您组织目前所在的 Office 365 或 Exchange Online DNS。为此,运行以下命令配置一个已知名称的接受域,它将会正确地将电子邮件消息路由到 Office 365 或 Exchange Online 域。On the legacy Exchange server, make sure that routing to the mail-enabled public folders that will exist in Office 365 or Exchange Online continues to work until all DNS caches over the Internet are updated to point to the Office 365 or Exchange Online DNS where your organization now resides. To do this, run the following command to configure an accepted domain with a well-known name that will properly route email messages to the Office 365 or Exchange Online domain.

    New-AcceptedDomain -Name "PublicFolderDestination_78c0b207_5ad2_4fee_8cb9_f373175b3f99" -DomainName contoso.onmicrosoft.com -DomainType InternalRelay 
    

如果公用文件夹的名称中包含反斜线 (\ ) 或正斜杠 ( / ),当迁移发生时可能会在父公用文件夹中创建公用文件夹。在迁移之前,我们建议您重命名的任何名称中具有斜线或的反斜线的公用文件夹。If the name of a public folder contains a backslash ( \ ) or a forward slash ( / ), the public folders might be created in the parent public folder when migration occurs. Before you migrate, we recommend that you rename any public folders that have a backslash or a forward slash in the name.

在 Exchange 2010 中,若要找到名称中包含反斜杠的公用文件夹,请运行以下命令:In Exchange 2010, to locate public folders that have a backslash in the name, run the following command:

Get-PublicFolderStatistics -ResultSize Unlimited | Where {($_.Name -like "*\*") -or ($_.Name -like "*/*") } | Format-List Name, Identity
  1. 您可以使用以下命令对返回的任何公用文件夹进行重命名:If any public folders are returned, you can rename them by running the following command:

    Set-PublicFolder -Identity <public folder identity> -Name <new public folder name>
    
  2. 确保之前没有成功迁移的记录。如果存在,则需要将该值设置为 $false。如果该值设置为 $true,则迁移请求将失败。Make sure there isn't a previous record of a successful migration. If there is, you'll need to set that value to $false. If the value is set to $true, the migration request will fail.

下面的示例检查公用文件夹迁移状态。The following example checks the public folder migration status.

Get-OrganizationConfig | Format-List PublicFoldersLockedforMigration, PublicFolderMigrationComplete
  1. 如果 PublicFoldersLockedforMigrationPublicFolderMigrationComplete 属性的状态为 $true,请使用下面的命令将此值设置为 $falseIf the status of the PublicFoldersLockedforMigration or PublicFolderMigrationComplete properties is $true, run the following command to set the value to $false.

    Set-OrganizationConfig -PublicFoldersLockedforMigration:$false -PublicFolderMigrationComplete:$false
    

    小心

    重置这些属性后,您必须等待 Exchange 检测到新设置。此过程最多可能需要两个小时才能完成。After resetting these properties, you need to wait for Exchange to detect the new settings. This may take up to two hours to complete.

  2. 为了在迁移结束时进行验证,我们建议您先在旧版 Exchange 服务器上运行以下 Exchange 命令行管理程序 命令,获取当前公用文件夹部署的快照。For verification purposes at the end of migration, we recommend that you first run the following Exchange Management Shell commands on the legacy Exchange server to take snapshots of your current public folder deployment.

运行以下命令以获取原始源文件夹结构的快照。Run the following command to take a snapshot of the original source folder structure.

Get-PublicFolder -Recurse | Export-CliXML C:\PFMigration\Legacy_PFStructure.xml

运行以下命令以获取公用文件夹统计信息(如项目计数、大小和所有者)的快照。Run the following command to take a snapshot of public folder statistics such as item count, size, and owner.

Get-PublicFolderStatistics -ResultSize Unlimited | Export-CliXML C:\PFMigration\Legacy_PFStatistics.xml

运行以下命令获取权限的快照。Run the following command to take a snapshot of the permissions.

Get-PublicFolder -Recurse | Get-PublicFolderClientPermission | Select-Object Identity,User -ExpandProperty AccessRights | Export-CliXML C:\PFMigration\Legacy_PFPerms.xml
Save the information from the preceding commands for comparison at the end of the migration.
  1. 如果您使用 Microsoft Azure Active Directory 连接 (Azure AD 连接) 与 Azure Active Directory 同步您的本地目录,您需要执行以下操作 (如果您不使用 Azure AD 连接,则可以跳过此步骤):If you are using Microsoft Azure Active Directory Connect (Azure AD Connect) to synchronize your on-premises directories with Azure Active Directory, you need to do the following (if you are not using Azure AD Connect, you can skip this step):

答: 在本地计算机上,打开 Microsoft Azure Active Directory 连接,然后选择配置a. On an on-premises computer, open Microsoft Azure Active Directory Connect, and then select Configure.

b.在其他任务屏幕上,选择自定义同步选项,然后单击下一步b. On the Additional tasks screen, select Customize synchronization options, and then click Next.

c.在连接到 Azure AD屏幕上,输入相应的凭据,,然后单击下一步。直到可选功能屏幕上,连接之后,继续单击下一步c. On the Connect to Azure AD screen, enter the appropriate credentials, and then click Next. Once connected, keep clicking Next until you are on the Optional Features screen.

d.确保未选择的Exchange 邮件公用文件夹。如果选中,您可以继续下一节, Office 365 或 Exchange Online 中的先决条件步骤。如果选择它,则单击以清除该复选框,,然后单击下一步d. Make sure that Exchange Mail Public Folders is not selected. If it isn't selected, you can continue to the next section, Prerequisite steps in Office 365 or Exchange Online . If it is selected, click to clear the check box, and then click Next.

> [!NOTE]
> If you don't see **Exchange Mail Public Folders** as an option on the **Optional Features** screen, you can exit Microsoft Azure Active Directory Connect and proceed to the next section,  *Prerequisite steps in Office 365 or Exchange Online*  . 
  1. 清除Exchange 邮件公用文件夹所选内容后,单击下一步,直到位于已准备好配置屏幕中,保留,然后单击配置After you have cleared the Exchange Mail Public Folders selection, keep clicking Next until you are on the Ready to configure screen, and then click Configure.

有关语法和参数的详细信息,请参阅下列主题:For detailed syntax and parameter information, see the following topics:

  1. 请确保没有现有的公用文件夹迁移请求。如果有,请清除它们,否则您自己的迁移请求将会失败。并非所有情况都需要此步骤;只有在您认为管道中可能存在现有迁移请求时,才需要此步骤。Make sure there are no existing public folder migration requests. If there are, clear them or your own migration request will fail. This step isn't required in all cases; it's only required if you think there may be an existing migration request in the pipeline.

    现有的迁移请求可以是下列两种类型之一:批处理迁移或串行迁移。用于检测每种类型请求和删除每种类型请求的命令如下所示。An existing migration request can be one of two types: batch migration or serial migration. The commands for detecting requests for each type and for removing requests of each type are as follows.

    重要

    在删除迁移请求之前,请务必了解现有公用文件夹的存在原因。运行以下命令可以确定上一个请求的提出时间并诊断可能发生的任何问题。您可能需要与组织中的其他管理员沟通,以确定更改原因。Before removing a migration request, it is important to understand why there was an existing one. Running the following commands will determine when a previous request was made and help you diagnose any problems that may have occurred. You may need to communicate with other administrators in your organization to determine why the change was made.

    下面的示例会发现任何现有的串行迁移请求。The following example will discover any existing serial migration requests.

    Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics -IncludeReport | Format-List
    

    下面的示例展示了如何删除任何现有的公用文件夹串行迁移请求。The following example removes any existing public folder serial migration requests.

    Get-PublicFolderMigrationRequest | Remove-PublicFolderMigrationRequest
    

    下面的示例会发现任何现有的批处理迁移请求。The following example will discover any existing batch migration requests.

    $batch = Get-MigrationBatch | ?{$_.MigrationType.ToString() -eq "PublicFolder"}
    

    下面的示例展示了如何删除任何现有的公用文件夹批处理迁移请求。The following example removes any existing public folder batch migration requests.

    $batch | Remove-MigrationBatch -Confirm:$false
    
  2. 确保 Office 365 中不存在任何公用文件夹或公用文件夹邮箱。Make sure no public folders or public folder mailboxes exist in Office 365.

    重要

    如果您在 Office 365 或 Exchange Online 中发现了公用文件夹,在删除公用文件夹和公用文件夹邮箱之前必须确定它们为什么存在以及您组织中的哪个人启动了公用文件夹层次结构,这一点至关重要。If you do see public folders in Office 365 or Exchange Online, it is important to determine why they are there and who in your organization started a public folder hierarchy before removing the public folders and public folder mailboxes.

  3. 在 Office 365 或 Exchange Online PowerShell 中,运行以下命令,检查是否存在任何公用文件夹邮箱。In Office 365 or Exchange Online PowerShell, run the following command to see if any public folders mailboxes exist.

    Get-Mailbox -PublicFolder 
    
  4. 如果该命令没有返回任何公用文件夹邮箱,请继续进行步骤 3:生成 .csv 文件。如果该命令返回了所有公用文件夹邮箱,则运行以下命令,看看是否存在任何公用文件夹:If the command didn't return any public folder mailboxes, continue to Step 3: Generate the .csv files. If the command returned any public folders mailboxes, run the following command to see if any public folders exist:

    Get-PublicFolder
    
  5. 如果 Office 365 或 Exchange Online 中有公用文件夹,则运行以下 Exchange Online PowerShell 命令将其删除。请确保您已保存了 Office 365 中公用文件夹内的任何信息。删除公用文件夹后,公用文件夹中包含的所有信息将永久删除。If you have any public folders in Office 365 or Exchange Online, run the following PowerShell command to remove them. Make sure you've saved any information that was in the public folders in Office 365. All information contained in the public folders will be permanently deleted when you remove the public folders.

    Get-MailPublicFolder | where {$_.EntryId -ne $null}| Disable-MailPublicFolder -Confirm:$false 
    Get-PublicFolder -GetChildren \ | Remove-PublicFolder -Recurse -Confirm:$false
    
  6. 删除公用文件夹之后,运行以下命令删除所有公用文件夹邮箱。After the public folders are removed, run the following commands to remove all public folder mailboxes.

    $hierarchyMailboxGuid = $(Get-OrganizationConfig).RootPublicFolderMailbox.HierarchyMailboxGuid
    Get-Mailbox -PublicFolder:$true | Where-Object {$_.ExchangeGuid -ne $hierarchyMailboxGuid} | Remove-Mailbox -PublicFolder -Confirm:$false
    Get-Mailbox -PublicFolder:$true | Where-Object {$_.ExchangeGuid -eq $hierarchyMailboxGuid} | Remove-Mailbox -PublicFolder -Confirm:$false
    

有关语法和参数的详细信息,请参阅下列主题:For detailed syntax and parameter information, see the following topics:

第 3 步:生成 .csv 文件Step 3: Generate the .csv files

  1. 在旧版 Exchange 服务器上,运行Export-PublicFolderStatistics.ps1脚本来创建文件夹名称到文件夹大小的映射文件。此脚本需要始终都运行的本地管理员。该文件将包含两列: FolderNameFolderSize。将以字节为单位显示FolderSize列的值。例如, \PublicFolder01,10000On the legacy Exchange server, run the Export-PublicFolderStatistics.ps1 script to create the folder name-to-folder size mapping file. This script needs to always be run by a local administrator. The file will contain two columns: FolderName and FolderSize. The values for the FolderSize column will be displayed in bytes. For example, \PublicFolder01,10000.

    .\Export-PublicFolderStatistics.ps1  <Folder to size map path> <FQDN of source server>
    
    • FQDN of source server 等于托管公用文件夹层次结构的邮箱服务器的完全限定域名。FQDN of source server equals the fully qualified domain name of the Mailbox server where the public folder hierarchy is hosted.

    • Folder to size map path 等于要用于保存 .csv 文件的网络共享文件夹上的文件名称和路径。主题后面部分中,您将需要使用 Exchange Online PowerShell 来访问此文件。如果您仅指定文件名,则将在本地计算机上的当前 PowerShell 目录中生成文件。Folder to size map path equals the file name and path on a network shared folder where you want the .csv file saved. Later in this topic, you'll need to use the Exchange Online PowerShell to access this file. If you specify only the file name, the file will be generated in the current PowerShell directory on the local computer.

    • 如有必要,从脚本输出删除任何已启用邮件的系统文件夹,然后再继续。If necessary, remove any mail-enabled system folders from the script output before proceeding.

  2. 运行 PublicFolderToMailboxMapGenerator.ps1 脚本来创建公用文件夹到邮箱的映射文件。此文件用于计算 Exchange Online 中公用文件夹邮箱的正确数量。Run the PublicFolderToMailboxMapGenerator.ps1 script to create the public folder-to-mailbox mapping file. This file is used to calculate the correct number of public folder mailboxes in Exchange Online.

    .\PublicFolderToMailboxMapGenerator.ps1 <Maximum mailbox size in bytes> <Folder to size map path> <Folder to mailbox map path>
    

    重要

    公用文件夹到邮箱映射文件不应超过 1,000 行。如果此文件超过 1,000 行,您的公用文件夹结构需要简化。继续执行大于 1000 行的文件不建议,也可能会导致迁移错误。The public folder-to-mailbox mapping file should not exceed 1,000 rows. If this file exceeds 1,000 rows, your public folder structure needs to be simplified. Proceeding with a file of greater than 1,000 rows is not recommended and could cause migration errors.

    • 运行脚本之前,使用以下 cmdlet 检查 Exchange Online 租户中的当前公用文件夹限制。然后,记下的公用文件夹的当前配额值。Get-OrganizationConfig | fl *quota*Before you run the script, use the following cmdlet to check the current public folder limits in your Exchange Online tenant. Then, note the current quota values for public folders. Get-OrganizationConfig | fl *quota*

      在 Exchange Online 中,默认值为 1.7 GB 用于DefaultPublicFolderIssueWarningQuotaDefaultPublicFolderProhibitPostQuota的 2 GB。In Exchange Online, the default value is 1.7 GB for DefaultPublicFolderIssueWarningQuota and 2 GB for DefaultPublicFolderProhibitPostQuota.

    • 最大邮箱 size in bytes_等于您想要为新的公用文件夹邮箱的最大大小。Exchange Online 中公用文件夹邮箱的最大大小是 100 GB。我们建议您使用 15 GB 的设置,以便每个公用文件夹邮箱具有增大空间。Exchange Online 具有 2 gb 的默认公用文件夹"限度时禁止投递"配额。如果必须大于 2 GB 的各个公用文件夹,可以使用以下选项之一来解决此问题:_Maximum mailbox size in bytes equals the maximum size that you want to set for the new public folder mailboxes. In Exchange Online, the maximum size of public folder mailboxes is 100 GB. We recommend that you use a setting of 15 GB so that each public folder mailbox has room to grow. Exchange Online has a default public folder "prohibit post" quota of 2 GB. If you have individual public folders that are larger than 2 GB, you can use any of the following options to fix this issue:

    • 启动迁移批处理之前,请通过运行以下 cmdlet 来增加的默认公用文件夹"限度时禁止投递"配额:Before you start the migration batch, increase the default public folder "prohibit post" quota by running the following cmdlet:

      Set-OrganizationConfig -DefaultPublicFolderProhibitPostQuota <size value> -DefaultPublicFolderIssueWarningQuota <size value>

    • 启动迁移批处理之前,删除公用文件夹内容的内容大小减少到 2 GB 或更少。Before you start the migration batch, delete public folder content to reduce the size of the content to 2 GB or less.

    • 启动迁移批处理之前,请将公用文件夹拆分到多个公用文件夹,每个 2 GB 或更少。Before you start the migration batch, split the public folder into multiple public folders that are each 2 GB or less.

      备注

      如果公用文件夹大于 30 GB,并且如果它不可行删除内容或拆分为多个公用文件夹,我们建议您不将您的公用文件夹移动到 Exchange Online。If the public folder is larger than 30 GB, and if it isn't feasible to delete content or split it into multiple public folders, we recommend that you don't move your public folders to Exchange Online.

    • Folder to 大小 map path_等于您运行时创建的.csv 文件的文件路径Export-PublicFolderStatistics.ps1脚本。_Folder to size map path equals the file path of the .csv file that you created when you ran the Export-PublicFolderStatistics.ps1 script.

    • Folder to 邮箱 map path_等于的文件名和您在此步骤中创建的文件夹到邮箱.csv 文件的路径。如果您指定的文件名,是本地计算机上的当前 PowerShell 目录中生成的文件。_Folder to mailbox map path equals the file name and path of the folder-to-mailbox .csv file that you create in this step. If you specify only the file name, the file is generated in the current PowerShell directory on the local computer.

备注

将运行的脚本并生成.csv 文件之后,,系统将不收集任何新的公用文件夹或更新现有的公用文件夹。After the scripts are run and the .csv files are generated, any new public folders or updates to existing public folders will not be collected.

步骤 4:在 Exchange Online 中创建公用文件夹邮箱Step 4: Create the public folder mailboxes in Exchange Online

  1. 运行以下命令来创建目标公用文件夹邮箱。脚本将通过运行 PublicFoldertoMailboxMapGenerator.ps1 脚本,为您之前在步骤 3 中生成的 .csv 文件中的每个邮箱创建一个目标邮箱。Run the following command to create the target public folder mailboxes. The script will create a target mailbox for each mailbox in the .csv file that you generated previously in Step 3, by running the PublicFoldertoMailboxMapGenerator.ps1 script.

    .\Create-PublicFolderMailboxesForMigration.ps1 -FolderMappingCsv Mapping.csv -EstimatedNumberOfConcurrentUsers:<estimate>
    

    Mapping.csv 是由 PublicFoldertoMailboxMapGenerator.ps1 脚本在步骤 3 中生成的文件。同时浏览某个公用文件夹层次结构的用户连接估计数量通常少于组织中的用户总数。Mapping.csv is the file generated by the PublicFoldertoMailboxMapGenerator.ps1 script in Step 3. The estimated number of simultaneous user connections browsing a public folder hierarchy is usually less than the total number of users in an organization.

第 5 步:启动迁移请求Step 5: Start the migration request

  1. 在旧版 Exchange 服务器上,运行以下命令,将启用邮件的公用文件夹从本地 Active Directory 同步到 Exchange Online。On the legacy Exchange server, run the following command to synchronize mail-enabled public folders from your local Active Directory to Exchange Online.

    Sync-MailPublicFolders.ps1 -Credential (Get-Credential) -CsvSummaryFile:sync_summary.csv
    

    Credential 是您的 Office 365 用户名和密码。 CsvSummaryFile 是您要以 .CSV 格式记录同步操作和错误的文件路径。Credential is your Office 365 user name and password. CsvSummaryFile is the file path to where you would like to log, in .CSV format, synchronization operations and errors.

    备注

    我们建议您先模拟脚本操作,然后再实际运行此脚本(为此,可使用 -WhatIf 参数)。We recommend that you first simulate the actions that the script would take before actually executing it, which you can do by running the script with a -WhatIf parameter.

  2. 在旧版 Exchange 服务器上,获取运行迁移请求所需的以下信息:On the legacy Exchange server, get the following information that's needed to run the migration request:

  3. 查找用户帐户的 LegacyExchangeDN,该用户帐户是"公用文件夹管理员"角色的成员。这将是此过程步骤 3 中您所需凭据的同一用户。Find the LegacyExchangeDN of the user's account who is a member of the Public Folder Administrator role. This will be the same user whose credentials you need in step 3 of this procedure.

    Get-Mailbox <PublicFolder_Administrator_Account> | Select-Object LegacyExchangeDN
    
  4. 查找具有公用文件夹数据库的任何邮箱服务器的 LegacyExchangeDNFind the LegacyExchangeDN of any Mailbox server that has a public folder database.

    Get-ExchangeServer <public folder server> | Select-Object -Expand ExchangeLegacyDN
    
  5. 查找 Outlook 无处不在 主机名的 FQDN。如果您有多个 Outlook 无处不在 实例,我们建议您选择最接近迁移终结点的实例或最接近旧版 Exchange 组织中公用文件夹副本的实例。以下命令将找到 Outlook 无处不在 的所有实例:Find the FQDN of the Outlook Anywhere host name. If you have multiple instances of Outlook Anywhere, we recommend that you select the instance that is either closest to the migration endpoint or the one that is closest to the public folder replicas in the legacy Exchange organization. The following command will find all instances of Outlook Anywhere:

    Get-OutlookAnywhere | Format-Table Identity,ExternalHostName
    
  6. 在 Office 365 PowerShell 中,运行以下命令,将前一步骤返回的信息传递到将在迁移请求中使用的变量。In Office 365 PowerShell, run the following commands to pass the information that was returned in the previous step to variables that will then be used in the migration request.

  7. 将旧版 Exchange 服务器上具有管理权限的用户凭据传递到 $Source_Credential 变量中。Exchange Online 中运行的迁移请求将使用此凭据获取对旧版 Exchange 服务器的访问,以复制内容。Pass the credential of a user who has administrative permissions on the legacy Exchange server into the variable $Source_Credential. The migration request that's run in Exchange Online will use this credential to gain access to your legacy Exchange servers to copy the content over.

    $Source_Credential = Get-Credential <source_domain\PublicFolder_Administrator_Account>
    
  8. 使用步骤 2a 中找到的旧版 Exchange 服务器上迁移用户的 ExchangeLegacyDN,将它传递到变量 $Source_RemoteMailboxLegacyDN 中。Use the ExchangeLegacyDN of the migration user on the legacy Exchange server that you found in step 2a and pass it into the variable $Source_RemoteMailboxLegacyDN.

    $Source_RemoteMailboxLegacyDN = "<paste the value here>"
    
  9. 使用以上步骤 2b 中找到的公用文件夹服务器的 ExchangeLegacyDN,将它传递到变量 $Source_RemotePublicFolderServerLegacyDNUse the ExchangeLegacyDN of the public folder server that you found in step 2b above and pass it into the variable $Source_RemotePublicFolderServerLegacyDN.

    $Source_RemotePublicFolderServerLegacyDN = "<paste the value here>"
    
  10. 使用以上步骤 2c 中找到的 Outlook 无处不在 的外部主机名,将它传递到变量 $Source_OutlookAnywhereExternalHostName 中。Use the External Host Name of Outlook Anywhere that you found in step 2c above and pass it into the variable $Source_OutlookAnywhereExternalHostName.

    $Source_OutlookAnywhereExternalHostName = "<paste the value here>"
    
  11. 最后,在 Exchange Online PowerShell 中,运行以下命令,创建迁移请求。Finally, in Exchange Online PowerShell, run the following commands to create the migration request.

    备注

    以下 Exchange 命令行管理程序 示例中的身份验证方法必须匹配您的 Outlook 无处不在 设置,否则命令将失败。The authentication method in the following Exchange Management Shell example needs to match your Outlook Anywhere settings, otherwise the command will fail.

    $PfEndpoint = New-MigrationEndpoint -PublicFolder -Name PublicFolderEndpoint -RPCProxyServer $Source_OutlookAnywhereExternalHostName -Credentials $Source_Credential -SourceMailboxLegacyDN $Source_RemoteMailboxLegacyDN -PublicFolderDatabaseServerLegacyDN $Source_RemotePublicFolderServerLegacyDN -Authentication Basic
    [byte[]]$bytes = Get-Content -Encoding Byte <folder_mapping.csv>
    New-MigrationBatch -Name PublicFolderMigration -CSVData $bytes -SourceEndpoint $PfEndpoint.Identity -NotificationEmails <email addresses for migration notifications>
    

    其中 < folder_mapping.csv> 文件是在步骤 3:生成 .csv 文件中生成的。Where the < folder_mapping.csv> file is the file that was generated in Step 3: Generate the .csv files.

  12. 使用以下命令开始迁移:Start the migration using the following command:

    Start-MigrationBatch PublicFolderMigration
    

尽管批处理迁移的创建需要使用 Exchange 命令行管理程序 中的 New-MigrationBatch cmdlet,但是迁移的进度和完成情况可在 EAC 中进行查看和管理。因为 New-MigrationBatch cmdlet 可启动每个公用文件夹邮箱的邮箱迁移请求,你可以使用邮箱迁移页查看这些请求的状态。你可以进入邮箱迁移页,通过执行下列操作,创建可以通过电子邮件发送给你的迁移报告:While batch migrations need to be created using the New-MigrationBatch cmdlet in the Exchange Management Shell, the progress and completion of the migration can be viewed and managed in the EAC. Because the New-MigrationBatch cmdlet initiates a mailbox migration request for each public folder mailbox, you can view the status of these requests using the mailbox migration page. You can get to the mailbox migration page, and create migration reports that can be emailed to you, by doing the following:

  1. 登录 Exchange Online 并打开 EAC。Log into Exchange Online and open the EAC.

  2. 导航到邮箱 > 迁移Navigate to Mailbox > Migration.

  3. 选择刚刚创建的迁移请求,然后单击详细信息窗格中的查看详细信息Select the migration request that was just created and then click View Details in the Details pane.

有关语法和参数的详细信息,请参阅下列主题:For detailed syntax and parameter information, see the following topics:

步骤 6:锁定旧版 Exchange 服务器上的公用文件夹以进行最终迁移(需要停机时间)Step 6: Lock down the public folders on the legacy Exchange server for final migration (downtime required)

在迁移过程中的此步骤之前,用户都可以访问公用文件夹。后续步骤会将用户从旧版公用文件夹中注销,并锁定这些文件夹直到迁移完成最终同步时为止。在此过程中,用户无法访问公用文件夹。此外,发送到启用邮件的公用文件夹的任何邮件都会排队,并且在公用文件夹迁移完成前不会进行传递。Until this point in the migration process, users have been able to access public folders. The next steps will log users off from the legacy public folders and lock the folders while the migration completes its final synchronization. Users won't be able to access public folders during this process. Also, any mail sent to mail-enabled public folders will be queued and won't be delivered until the public folder migration is complete.

在运行之前PublicFoldersLockedForMigration命令如下所述,请确保所有作业都处于同步状态。您可以执行此操作通过运行Get-PublicFolderMailboxMigrationRequest命令。只有您已验证的所有作业都处于同步状态后,继续此步骤。Before you run the PublicFoldersLockedForMigration command as described below, make sure that all jobs are in the Synced state. You can do this by running the Get-PublicFolderMailboxMigrationRequest command. Continue with this step only after you've verified that all jobs are in the Synced state.

在旧版 Exchange 服务器中,运行以下命令锁定旧版公用文件夹,以便完成迁移。On the legacy Exchange server, run the following command to lock the legacy public folders for finalization.

Set-OrganizationConfig -PublicFoldersLockedForMigration:$true

有关语法和参数的详细信息,请参阅 set-OrganizationConfigFor detailed syntax and parameter information, see set-OrganizationConfig.

如果组织具有多个公用文件夹数据库,则需要等到公用文件夹复制完成,才能确保所有公用文件夹数据库都选取了 PublicFoldersLockedForMigration 标志,且用户最近对文件夹进行的任何挂起更改都已在整个组织中进行了融合。这可能需要几个小时。If your organization has multiple public folder databases, you'll need to wait until public folder replication is complete to confirm that all public folder databases have picked up the PublicFoldersLockedForMigration flag and any pending changes users recently made to folders have converged across the organization. This may take several hours.

步骤 7:完成公用文件夹迁移(需要停机时间)Step 7: Finalize the public folder migration (downtime required)

若要完成公用文件夹迁移,请运行以下命令:To complete the public folder migration, run the following command:

Complete-MigrationBatch PublicFolderMigration

完成迁移后,Exchange 将执行最后一个旧 Exchange server 和 Exchange Online 之间同步。如果在最终同步成功,Exchange Online 中的公用文件夹将解除锁定和迁移批次的状态将更改为已完成。从同步完成需要其状态更改之前的几个小时的迁移批次的情况很常见,在最终同步将开始在哪一点。When you complete the migration, Exchange will perform a final synchronization between the legacy Exchange server and Exchange Online. If the final synchronization is successful, the public folders in Exchange Online will be unlocked and the status of the migration batch will changed to Completed. It is common for the migration batch to take a few hours before its status changes from Synced to Completing, at which point the final synchronization will begin.

如果已在本地 Exchange 服务器和 Office 365 之间配置混合部署,则在迁移完成后,需要在 Exchange Online PowerShell 中运行以下命令:If you've configured a hybrid deployment between your on-premises Exchange servers and Office 365, you need to run the following command in Exchange Online PowerShell after migration is complete:

Set-OrganizationConfig -RemotePublicFolderMailboxes $Null -PublicFoldersEnabled Local

步骤 8:测试和解锁公用文件夹迁移Step 8: Test and unlock the public folder migration

完成公用文件夹迁移之后,您应该运行以下测试,确保迁移成功。这样便能够在转而使用 Office 365 或 Exchange Online 公用文件夹之前测试迁移的公用文件夹层次结构。After you finalize the public folder migration, you should run the following test to make sure that the migration was successful. This allows you to test the migrated public folder hierarchy before you switch to using Office 365 or Exchange Online public folders.

  1. 在 Office 365 或 Exchange Online PowerShell 中,指定一些测试邮箱将任何新迁移的公用文件夹邮箱用作默认公用文件夹邮箱。In Office 365 or Exchange Online PowerShell, assign some test mailboxes to use any newly migrated public folder mailbox as the default public folder mailbox.

    Set-Mailbox -Identity <Test User> -DefaultPublicFolderMailbox <Public Folder Mailbox Identity>
    
  2. 登录到 Outlook 2010 或更高版本上一步中标识的测试用户,然后执行以下公用文件夹测试:Log on to Outlook 2010 or later with the test user identified in the previous step, and then perform the following public folder tests:

    • 查看层次结构。View the hierarchy.

    • 检查权限。Check permissions.

    • 创建和删除公用文件夹。Create and delete public folders.

    • 在公用文件夹中发布内容以及从中删除内容。Post content to and delete content from a public folder.

  3. 如果您遇到的任何问题,请参阅本主题后面的回滚迁移。如果公用文件夹内容和层次结构是可接受的并且预期,继续下一步。If you run into any issues, see Roll back the migration later in this topic. If the public folder content and hierarchy is acceptable and functions as expected, continue to the next step.

  4. 在旧版 Exchange 服务器中,运行以下命令,以指示公用文件夹迁移已完成:On the legacy Exchange server, run the following command to indicate that the public folder migration is complete:

    Set-OrganizationConfig -PublicFolderMigrationComplete:$true
    
  5. 确认迁移完成后,在 Exchange Online PowerShell 中的命令行管理程序中运行以下命令,确保 Set-OrganizationConfig 上的 PublicFoldersEnabled 参数设置为 LocalAfter you've verified that migration is complete, run the following command in Exchange Online PowerShell to make sure that the PublicFoldersEnabled parameter on Set-OrganizationConfig is set to Local:

    Set-OrganizationConfig -PublicFoldersEnabled Local
    

有关语法和参数的详细信息,请参阅下列主题:For detailed syntax and parameter information, see the following topics:

Set-MailboxSet-Mailbox

Get-MailboxGet-Mailbox

设置 OrganizationConfigset-OrganizationConfig

我如何知道这有效?How do I know this worked?

步骤 2:准备迁移中,我们建议您在开始迁移前先获取公用文件夹结构、统计信息和权限的快照。以下步骤会帮助您在迁移完成后获取相同的快照,以验证公用文件夹迁移是否成功。然后,您可以通过比较这两个文件中的数据来验证迁移是否成功。In Step 2: Prepare for the migration, you were instructed to take snapshots of the public folder structure, statistics, and permissions before the migration began. The following steps will help verify that your public folder migration was successful by taking the same snapshots after the migration is complete. You can then compare the data in both files to verify success.

  1. 在 Exchange Online PowerShell 中,运行以下命令以获取新文件夹结构的快照。In Exchange Online PowerShell, run the following command to take a snapshot of the new folder structure.

    Get-PublicFolder -Recurse | Export-CliXML C:\PFMigration\Cloud_PFStructure.xml
    
  2. 在 Exchange Online PowerShell 中,运行以下命令以获取公用文件夹统计信息(如项目计数、大小和所有者)的快照。In Exchange Online PowerShell, run the following command to take a snapshot of the public folder statistics such as item count, size, and owner.

    Get-PublicFolderStatistics -ResultSize Unlimited | Export-CliXML C:\PFMigration\Cloud_PFStatistics.xml
    
  3. 在 Exchange Online PowerShell 中,运行以下命令以获取权限的快照。In Exchange Online PowerShell, run the following command to take a snapshot of the permissions.

    Get-PublicFolder -Recurse | Get-PublicFolderClientPermission | Select-Object Identity,User -ExpandProperty AccessRights | Export-CliXML  C:\PFMigration\Cloud_PFPerms.xml
    

从旧版 Exchange 服务器中删除公用文件夹数据库Remove public folder databases from the legacy Exchange servers

在迁移完成且您已验证 Exchange Online 公用文件夹可按预期方式工作后,您应该删除旧版 Exchange 服务器中的公用文件夹数据库。After the migration is complete, and you have verified that your Exchange Online public folders are working as expected, you should remove the public folder databases on the legacy Exchange servers.

重要

因为你的所有邮箱在公用文件夹迁移前已被迁移至 Office 365,所以我们强烈建议你通过 Office 365(分散式邮件流)而非你本地环境的集中式邮件流传送流量。如果选择保持集中式邮件流,则可能导致公用文件夹的传送问题,因为你已从你的本地组织中删除公用文件夹邮箱数据库。Since all of your mailboxes have been migrated to Office 365 prior to the public folder migration, we strongly recommend that you route the traffic through Office 365 (decentralized mail flow) instead of centralized mail flow through your on-premises environment. If you choose to keep mail flow centralized, it could cause delivery issues to your public folders, since you've removed the public folder mailbox databases from your on-premises organization.

回滚迁移Roll back the migration

如果在迁移过程中遇到问题,并且需要重新激活旧版 Exchange 公用文件夹,请执行以下步骤。If you run into issues with the migration and need to reactivate your legacy Exchange public folders, perform the following steps.

小心

如果您将迁移回滚到旧版 Exchange 服务器,将丢失发送到已启用邮箱的公用文件夹中的任何电子邮件或迁移后投递到公用文件夹的内容。为保存此内容,需将公用文件夹内容导出到 .pst 文件,然后在回滚完成时将它导入到旧版公用文件夹。If you roll your migration back to the legacy Exchange servers, you will lose any email that was sent to mail-enabled public folders or content that was posted to public folders after the migration. To save this content, you need to export the public folder content to a .pst file and then import it to the legacy public folders when the rollback is complete.

  1. 在旧版 Exchange 服务器中,运行以下命令解锁旧版 Exchange 公用文件夹。此进程可能需要几个小时。On the legacy Exchange server, run the following command to unlock the legacy Exchange public folders. This process may take several hours.

    Set-OrganizationConfig -PublicFoldersLockedForMigration:$False
    
  2. 在 Exchange Online PowerShell 中,运行以下命令以删除所有 Exchange Online 公用文件夹。In Exchange Online PowerShell, run the following commands to remove all Exchange Online public folders.

    $hierarchyMailboxGuid = $(Get-OrganizationConfig).RootPublicFolderMailbox.HierarchyMailboxGuid
    Get-Mailbox -PublicFolder:$true | Where-Object {$_.ExchangeGuid -ne $hierarchyMailboxGuid} | Remove-Mailbox -PublicFolder -Confirm:$false -Force
    Get-Mailbox -PublicFolder:$true | Where-Object {$_.ExchangeGuid -eq $hierarchyMailboxGuid} | Remove-Mailbox -PublicFolder -Confirm:$false -Force
    
  3. 在旧版 Exchange 服务器中,运行以下命令,将 PublicFolderMigrationComplete 标志设置为 $falseOn the legacy Exchange server, run the following command to set the PublicFolderMigrationComplete flag to $false.

    Set-OrganizationConfig -PublicFolderMigrationComplete:$False
    

使用 Outlook PST 导出将公用文件夹迁移至 Office 365Migrate Public Folders to Office 365 by using Outlook PST export

如果您的内部部署公用文件夹层次结构大于 30 GB,我们建议您不要使用 Outlook PST 导出功能将公用文件夹迁移到 Office 365 或 Exchange Online。Office 365 Online 公用文件夹邮箱增长使用自动拆分功能进行管理,此功能可在公用文件夹邮箱超过大小配额时对其进行拆分。当您使用 PST 导出功能迁移公用文件夹时,自动拆分无法应对公用文件夹邮箱的突然增长,您可能必须至少等待两星期,自动拆分才会将数据从主邮箱中移出。此外,在使用 Outlook PST 将公用文件夹导出到 Office 365 或 Exchange Online 之前,请考虑以下事项:We recommend that you don't use Outlook's PST export feature to migrate public folders to Office 365 or Exchange Online if your on-premises public folder hierarchy is greater than 30 GB. Office 365 online public folder mailbox growth is managed using an auto-split feature that splits the public folder mailbox when it exceeds size quotas. Auto-split can't handle the sudden growth of public folder mailboxes when you use PST export to migrate your public folders and you may have to wait for up to two weeks for auto-split to move the data from the primary mailbox. In addition, consider the following before using Outlook PST to export public folders to Office 365 or Exchange Online:

  • 在此过程中,公用文件夹权限将会丢失。在迁移之前捕获当前权限,并在迁移完成后手动将其添加回去。Public folder permissions will be lost during this process. Capture the current permissions before migration and manually add them back once the migration is completed.

  • 如果您使用复杂权限或有很多文件夹要迁移,我们建议使用 cmdlet 方法进行迁移。If you use complex permissions or have many folders to migrate, we recommend that you use the cmdlet method for migration.

  • PST 导出迁移期间对源公用文件夹所做的任何项目和文件夹更改都将丢失。因此,如果此导出和导入过程需要很长一段时间才能完成,我们建议您使用 cmdlet 方法。Any item and folder changes made to the source public folders during the PST export migration will be lost. Therefore, we recommend that you use the cmdlet method if this export and import process will take a long time to complete.

如果您还是想使用 PST 文件迁移公用文件夹,请按照以下步骤操作,以确保迁移成功。If you still want to migrate your public folders by using PST files, follow these steps to ensure a successful migration.

  1. 使用第 1 步:下载迁移脚本中的说明下载迁移脚本。您只需下载 PublicFolderToMailboxMapGenerator.ps1 文件。Use the instructions in Step 1: Download the migration scripts to download the migration scripts. You only need to download the PublicFolderToMailboxMapGenerator.ps1 file.

  2. 按照步骤 3:生成 .csv 文件中的步骤 2 来创建公用文件夹到邮箱的映射文件。此文件用于计算 Exchange Online 中公用文件夹邮箱的正确数量。Follow step 2 of Step 3: Generate the .csv files to create the public folder-to-mailbox mapping file. This file is used to calculate the correct number of public folder mailboxes in Exchange Online.

  3. 创建公用文件夹邮箱,您将需要基于映射文件。有关详细信息,请参阅创建公用文件夹邮箱Create the public folder mailboxes that you'll need based on the mapping file. For more information, see Create a public folder mailbox.

  4. 使用 [New-PublicFolder] cmdlet 可以利用 Mailbox 参数在每个公用文件夹邮箱中创建顶级公用文件夹。Use the [New-PublicFolder] cmdlet to create the top-most public folder in each of the public folder mailboxes by using the Mailbox parameter.

  5. 使用 Outlook 导出和导入 PST 文件。Export and import the PST files using Outlook.

  6. 使用 EAC 的公用文件夹上设置权限。有关详细信息,请按照步骤 3: 分配对公用文件夹的权限设置新组织中的公用文件夹的这一主题。Set the permissions on the public folders using the EAC. For more information, follow Step 3: Assign permissions to the public folder in the Set up public folders in a new organization topic.

小心

如果您已经启动 PST 迁移并且遇到问题其中主邮箱已满,有两种恢复 PST 迁移: > 等待自动拆分将数据从主邮箱移动。这可能需要多达两周。但是,将无法接收新的内容自动拆分完成之前完全填充公用文件夹邮箱中的所有公用文件夹。>创建公用文件夹邮箱,然后使用 [New-publicfolder] cmdlet 与_Mailbox_参数在辅公用文件夹邮箱中创建的剩余的公用文件夹。本示例创建一个名为 PF201 辅公用文件夹邮箱中的新公用文件夹。If you've already started a PST migration and have run into an issue where the primary mailbox is full, you have two options for recovering the PST migration: > Wait for the auto-split to move the data from the primary mailbox. This may take up to two weeks. However, all the public folders in a completely filled public folder mailbox won't be able to receive new content until the auto-split completes. > Create a public folder mailbox and then use the [New-PublicFolder] cmdlet with the Mailbox parameter to create the remaining public folders in the secondary public folder mailbox. This example creates a new public folder named PF201 in the secondary public folder mailbox.