Skip Ribbon Commands
Skip to main content

Why do I get an error when I try to run the Public Folders mapping script?

Last Update: 7/5/2016 2:07 PM

Why do I get an error when I try to run the Public Folders mapping script?

Answer:

For errors (as shown in the screen shots below) that state that the Public Folders are in 'HoldforMigration' mode when running the scripts received from BitTitan Support, the most likely reason for this is that Public Folders are being run in hybrid mode.

There are more details below, as well as the steps to resolve this to successfully run the scripts from Support. Once the scripts have completed, hybrid mode can be re-enabled. The steps to do this are also included below.

 

When planning to migrate legacy Public Folders to Office 365, carefully read the Public Folder migration guide.

If the total size of the On-Premises Public Folders is greater than 50GB, the Migration Guide references KB004924 that will provide the necessary steps to contact Support and request the Public Folders mapping script.

Support will then send two (2) scripts that should be run on the Exchange Online PowerShell:

  • The first script creates all the necessary Public Folder mailboxes.
  • The second script creates all the Public Folders and maps them to specific mailboxes.

If using the Public Folders in Hybrid Mode (more information in KB005102), if the Office 365 users are still using the On-Premises Public Folders, it is not possible to create the Public Folders in Office 365.

When running the script to create the mailboxes, there will be a warning stating that the newly created Public Folder mailboxes were automatically put on hold for migration, due to the fact that the Office 365 Organization has the Public Folders configured as "Remote".

createMBXwarning.png 

When you try to run the script that creates the Public Folders, you will see the following error:

createPublicFoldersError.png 

All of the Public Folder mailboxes created were put in a 'HoldForMigration' state, and therefore it is not possible to create new Public Folders on Office 365.

This is caused by the fact that the Office 365 Organization has been configured to use the Public Folders in hybrid mode, so that users can access the On-Premises Public Folders.

Take a quick look at the root Public Folder mailbox, by running from the Exchange Online PowerShell: (Get-OrganizationConfig).rootpublicfoldermailbox |fl

RootPublicFolderMailbox.png 

The picture above shows that the root Public Folder mailbox is locked for migration. All other Public Folder mailboxes will also be unavailable. Now look at the Organization Configuration by running from the same PowerShell: Get-OrganizationConfig |fl *public*

OrganizationConfig.png 

The PublicFoldersEnabled attribute set to remote confirms that the Office 365 users are set to use the On-Premises Public Folders.

To resolve this issue, and to be able to run the scripts and create the Public Folders on Office 365:

  1. Remove all the existing Public Folder mailboxes on Office 365, by running on the Exchange Online PowerShell: Get-Mailbox -PublicFolder |Remove-Mailbox -PublicFolder
    Note: It may be necessary to run the cmdlet twice, because when there is more than one Public Folder mailbox, it is not possible to delete the primary mailbox before deleting the others.
    Warning: In a Hybrid scenario, where Public Folders are being used On-Premises, the Public Folder mailboxes on Office 365 should be empty and not have any relevant data. If unsure if the Public Folder mailboxes are empty, verify that they are empty before deleting them.
  2.  Once all of the Public Folder Mailboxes are deleted from Office 365, change the Organization Configuration to use Public Folders on Office 365, by running on the Exchange Online PowerShell: Set-OrganizationConfig -PublicFoldersEnabled Local -RemotePublicFolderMailboxes $null
    Warning: This will break the connectivity to the On-Premises Public Folders for all users with the mailbox on Office 365. Please plan a maintenance window.
  3. The Public Folder mapping scripts, provided by Support, should run now without any errors.
  4. Once the mapping scripts have run, run the following cmdlet on the Exchange Shell of the Source and the Destination to compare the number of Public Folders, and make sure that the numbers match: (Get-PublicFolder -recurse).count
  5. Now revert the Organization Configuration, and restore the access to the On-Premises Public Folders by running: Set-OrganizationConfig -PublicFoldersEnabled Remote -RemotePublicFolderMailboxes <YourOnPremisesPFMailbox> 

This last change can take a while to apply. To make sure that the change applied, run the following cmdlet: Get-Mailbox <username> |fl *public*

defaultPFMBX.png 

Once you are certain that the default Public Folder mailbox is the one On-Premises, inform the users that the access to the Public Folders has been restored. Again, this might take up to one hour, so plan the Public Folders downtime carefully.

Finally, since the Organization Configuration on Office 365 has been changed, revisit the KB005102 and follow the instructions to make sure that the MigrationWiz administrator on Office 365 has an Office 365 Public Folder mailbox as default.