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 were 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 before 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
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.
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.
- Perform the migration using MigrationWiz as described in the appropriate Migration Guide.
- 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.
- Click Edit Project.
- Select Advanced Options.
- Under Support Options add: DoNotMailEnablePublicFolders=1
- Before running the Security Pass, remove the mail-enabled public folder contacts from the destination. Specific steps can be found below.
- Remove the advanced support option DoNotMailEnablePublicFolders=1 from the project.
- Reset the item statistics for the project using the steps outlined in the following KB: How do I reset statistics for my item(s)?
- 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)
- 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