Migrating Mail-Enabled Public Folders in Hybrid Mode

This is not related to the Hybrid Exchange migration type. This deals specifically with a hybrid public folder migration, which is entirely different.

Before performing a public folder migration in a hybrid environment, the steps for setting up mail flow between the source mail-enabled public folders and the destination tenant for coexistence was most likely followed. The steps for setting this up include running a script named “Sync-MailPublicFolders” or “Sync-ModernMailPublicFolders” that enables Exchange Online users to send emails to on-premises mail enabled Public Folders, by creating mail objects in Exchange Online with the primary and all other SMTP addresses that those folders have in the on premises environment.

The Microsoft scripts are useful for coexistence but do not take into account using a migration solution outside of Microsoft tools for migrating public folders. This causes an issue during the migration where we try to mail-enable the Public Folders, and because the mail-enabled attribute already exists in the Destination, the Alias gets a 1 appended to it and the Name gets a random numeric value appended to ensure they are unique in the tenant.

For example, before using MigrationWiz, a mail-enabled folder that was synced prior to migrating using one of the above scripts will create a mail contact in the destination like the following:

Name: Folder A
Alias: FolderA
DisplayName: Folder A

If you use MigrationWiz to migrate the mail-enabled public folder that belongs to the contact in the example above, while it still exists in the destination tenant, the migrated folder will be mail-enabled using the following example format:

Name: Folder A 15701766
Alias: FolderA1
DisplayName: Folder A
PrimarySMTPAddress: FolderA1@domain.onmicrosoft.com

To avoid this behavior, the mail-enabled public folder contacts that exist in the destination must be removed BEFORE using MigrationWiz to mail-enable the migrated public folders. It is important to plan a window for this as it will break mail flow until the SMTP addresses have been added back to the newly migrated mail-enabled folders at the destination. 
Important Note: This article does not replace the Migration Guide for a specific scenario. There are specific steps and settings detailed in the Migration Guides that are not listed here. This article is specifically about handling synced mail-enabled public folder contacts within a Hybrid Public Folder migration.


Steps for addressing mail-enabled public folders in hybrid mode:

Remove the mail-enabled contacts from the destination after migrating and perform an additional pass to mail-enable the migrated public folders. This option is best suited for larger migrations, or for migrations with a higher mail-enabled folder count.

  1. Perform the migration using MigrationWiz as described in the appropriate Migration Guide.
  2. When setting up the first pass Advanced Options, add in the advanced support option DoNotMailEnablePublicFolders=1 to skip mail-enabling of public folders at the destination during the migration.
    1. Click Edit Project.
    2. Select Advanced Options.
    3. Under Support Options add: DoNotMailEnablePublicFolders=1
  3. Before running the Security Pass, remove the mail-enabled public folder contacts from the destination. Specific steps can be found below.
  4. Remove the advanced support option DoNotMailEnablePublicFolders=1 from the project.
  5. Reset the item statistics for the project using the steps outlined in the following KB: How do I reset statistics for my item(s)?
  6. Perform an additional full migration pass to mail-enable the migrated folders. (Note: The SMTP addresses will not be migrated, the only address assigned to the mail-enabled folders will be the default @domain.onmicrosoft.com address)
  7. Export and import the SMTP addresses using the steps outlined in the following KB: Migrating mail-enabled Public Folder email addresses.

Removing the synced mail-enabled public folder contacts

If there is a scheduled task to sync the source and destination mail-enabled public folders, it will need to be disabled before removing the contacts from the destination. After this has been completed run the following in a powershell session against the destination:

Get-MailPublicFolder -ResultSize Unlimited | Disable-MailPublicFolder

Once the commands have finished running against the destination, there should be 0 folders returned when running the following:

Get-MailPublicFolder -ResultSize Unlimited

Was this article helpful?
0 out of 1 found this helpful