Recovering Public Folder information in Exchange 2013, Part 2
Published Oct 28 2013 10:44 AM 43.9K Views

In the last related blog post we discussed recovering public folders and its contents from dumpster when they are deleted and various recovery steps using the Outlook client and Exchange Management Shell. In this blog we will be moving further and discussing some more advanced recovery scenarios.

Recovering a deleted public folder mailbox

Secondary Hierarchy mailboxes

Secondary hierarchy mailboxes contain public folder content as well as read-only copy of the public folder hierarchy. At mailbox creation, each public folder mailbox gets associated with its own disabled active directory user account. Those user accounts should never be deleted or modified! When deletion happens though, access to public folders in that content mailbox will get disrupted. The affected public folders will still be seen in the public folder hierarchy, but they might not be accessible since the mailbox holding the folder content is unavailable.

To understand this better let’s consider a scenario where active directory user account which is associated with the Secondary public folder hierarchy mailbox gets mistakenly deleted and it needs to be recovered. The name of the secondary public folder mailbox is called PF-2 and its associated disabled user account is now gone. The associated mailbox will be available in the associated database in disabled state till the retention period expires. During that time, public folders which are hosted on the disconnected secondary public folder mailbox will still show up in Outlook because they are still present in the hierarchy. The associated mailbox content information will be unavailable for the folders associated with the affected public folder content mailbox in Exchange Admin Center as illustrated here:

image

In order to perform recovery for such types of issues, you will need to create a new disabled user account and reconnect the disconnected public folder content mailbox by connecting to the new created account using Connect-Mailbox.

To view the disabled mailboxes run the command:

Get-MailboxDatabase | Get-MailboxStatistics | Where { $_.DisconnectReason -eq "Disabled" } | ft DisplayName,Database,DisconnectDate,DisconnectReason,*type*

image

If the public folder content mailbox is not listed in the disabled state but you know the account is missing, you need to force the cleanup on the store by running the below command:

Get-MailboxStatistics -Database “Database name“ | ForEach { Update-StoreMailboxState -Database $_.Database -Identity $_.MailboxGuid -Confirm:$false }

Note: Update-StoreMailboxState is the Exchange 2013 replacement for the Clean-MailboxDatabase in previous versions. When running this command, make sure you have proper retention settings in place or else you might end up purging disconnected mailboxes that you did not intend to purge!

As mentioned earlier, create a new user account with same name (like the mailbox, to keep things simpler) or, if the account has been recovered through some sort of AD recovery process, we can simply reconnect the mailbox to it. By creating account with same name the Connect-mailbox will automatically try to connect to the matching user.

Connect the mailbox using the Exchange Admin Center or Exchange Management Shell as described in the article Connect a Disabled Mailbox.

Once the mailbox is connected, the public folder should automatically start serving the contents.

Things to note about mail enabled public folders:

  • If the disconnected mailbox contained mail-enabled public folders, mail delivery to those folders will stop working once the content mailbox is connected with the new account. A sample of the error you might see:clip_image001
  • To get the mail enabled public folders working they have to be mail-disabled and mail-enabled again. Ref : Mail-Enable or Mail-Disable a Public Folder
  • If the mail enabled public folders had some custom SMTP addresses configured they might be lost by the process of mail disabling and re-enabling. Make sure you export the details of PrimarySMTPAddress for the required mail enabled public folders and then add the custom address back to the required public folders.

Recovery of Secondary mailbox when it gets deleted from Store.

At times situations may come up where the content public folder associated mailbox account is deleted and the associated public folder content mailbox also gets deleted from the mailbox database and it needs to be recovered. The associated public folders from the associated mailbox will remain in orphaned state in the public folder hierarchy as shown below

image

Note: Under usual circumstances, it is not possible to disable a public folder mailbox which is hosting the folders by using the Disable-Mailbox CMDLet. The associated folders and contents needs to be migrated to a different public folder mailbox prior to disabling it.

Let’s consider a scenario where a secondary public folder mailbox which contained a set of public folders with data has been deleted. In order to recover public folder data in such types of scenarios your only option is to restore the last full good backup for the affected mailbox.

Once the restore is completed using the recovery database, run the following CMDLet to see which mailboxes are available for recovery:

Get-MailboxStatistics –Database “Name of Recovery database”

To view a set of public folders which are orphaned in the organization run the command:

Get-PublicFolder –Recurse | Where { $_.ContentMailboxName –eq ‘’ }

image

Note: Before you begin with the restore process, you need to set the orphaned public folders to an active public folder content mailbox. You can create a public folder mailbox with same old name (you can get the mailbox name from the restored database by running Get-mailboxstatistics) and set the public folders to point to newly created mailbox. This can be done by executing the command:

Set-PublicFolder –Identity “\Name of the public folder” –OverrideContentmailbox “Name of the new content public folder mailbox”

If you skip above step and proceed further, the restore is going to fail since there is no target mailbox available to which data can be restored.

To set the mailbox for multiple orphaned public folders run the command:

Get-PublicFolder –Recurse | Where { $_.ContentMailboxName –eq ‘’ } | Set-PublicFolder –OverrideContentmailbox “Name of the content public folder mailbox”

Once the public folder has been pointed to an active public folder content mailbox, follow the method discussed earlier in the blog for merging the contents to required public folders from recovery database and that’s all. You should see the recovered contents in the recovered folders.

image

Note: In case you need to restore the contents from the entire public folder mailbox, do not use the –IncludeFolders switch. The restore process will restore the available data from recovery mailbox to all the available folders in the Target mailbox provided the folder structure is present. If you need to restore individual public folders, you can use the mentioned switch.

More information:

Recover from loss of primary hierarchy mailbox

How to recover primary hierarchy public folder mailbox when the Active Directory account is deleted?

The primary hierarchy mailbox is pretty much the most important component when it comes to public folder hierarchy. The primary hierarchy mailbox is the one writable copy of the public folder hierarchy. The public folder hierarchy is copied to all other public folder mailboxes, but these will be read-only copies. If this mailbox is disconnected or is not accessible it will affect all the public folders access and administration. When this happens it will no longer be possible to create new public folders since the primary public folder hierarchy mailbox is unavailable.

The following error will be seen when creation of new public folder is attempted and your public folders are in this state:

image

If the associated account for the public folders is deleted then, the primary hierarchy mailbox will remain in the database till the retention settings expire. The mailbox will be in a disabled state. Public folders themselves will not be visible in the Exchange Admin Center as shown below:

image

The recovery of this mailbox is possible provided the associated primary hierarchy mailbox is available in disconnected state in the associated mailbox database. You can create a new disabled user account with same name and then reconnect the mailbox using the Connect or Restore a Deleted Mailbox command to connect the mailbox as mentioned prior in the blog.

Recovering the primary hierarchy mailbox if it is deleted

When a primary hierarchy mailbox is deleted and past the database retention period the only option would be to restore the last full good backup for the database on which the primary hierarchy mailbox resides.

Recovering the public folder hierarchy structure would be only possible if you restore the database directly to the production or use the dial tone recovery method to recover the public folder hierarchy.

As you are recovering the database, any folder content which was modified, deleted or created after the backup of that database was taken might be lost. Once the database is restored and mounted the first thing that happens is that the primary hierarchy mailbox will initiate full hierarchy sync with all the secondary hierarchy mailboxes and only the hierarchy present from that last restored backup will be available.

Looking at the above possibility it becomes very important to plan for the high availability of public folders especially the primary hierarchy mailboxes and this is where the Database Availability Group can be the answer.

Few related notes:

  • To avoid issues with the deletion of the container and associated public folder accounts, we can enable the feature “Protect object from accidental deletion” on the AD container and the associated objects. For more information see Preventing Unwanted/Accidental deletions and Restore deleted objects in Active Directory
  • Set proper retention settings on the database and if required at individual public folders. Also ensure to plan backups properly in the environment in case a recovery is required.
  • Recommendation would be to use the Database Availability Group for public folder mailboxes to provide much needed high availability and prevent unwanted outages.

Conclusion

In the above blog post I tried to shed some light on how to recover the contents from secondary content public folder mailboxes after they are deleted and also discussed possible scenarios when primary hierarchy mailboxes could become unavailable. I plan to continue posting some additional more complex scenarios related to recovery of the public folder mailboxes / data.

I would like to again Thank Ben Winzenz, Bill Long, Charlotte Raymundo, Nino Bilic and Bhalchandra Atre for their help in reviewing this blog post.

Siddhesh Dalvi

13 Comments
Not applicable

Thanks, good Article for Exchange 2013 On-Premises customers with PF.

Not applicable

Awesome documentation... Sidd...

Not applicable

Great article! I've couple questions for PF restore:

1. How can we restore a public folder in RDB to another new folder without affecting the production folder?

For example, folder_A is still using in production server, but I want to restore folder_A from a early db backup to another new folder folder_A_for_audit. I don't want the restored content to affect the production folder_A.

2. Is there any way to browse and restore item-level content in a public folder in RDB so that we don't have to restore the whole folder?

3. Is there any way to restore public folder in RDB to a normal mailbox or PST file?

Thanks!

Simon

Not applicable

Good  article very helpful

Not applicable

Thanks Sid, Bhala and other MS folks ...Hope we have now more control on Public Folders Administration as compared to previous versions of Exchange specially in Exchange 2003.

Do you still use Exfolder to manage the security permission on public folder in Exchange 2013..? or you all manage through CMDLET

Rajeev Ujjwal

Not applicable

@ Rajeev: ExFolders will not work with Exchange 2013 for managing the public folders. You should use the GUI and shell commands to manage them.

Not applicable

@supcxc  : Please find the answers below

1. How can we restore a public folder in RDB to another new folder without affecting the production folder?

For example, folder_A is still using in production server, but I want to restore folder_A from a early db backup to another new folder folder_A_for_audit. I don't want the restored content to affect the production folder_A.

Answer : This will not work as the public folder restore process will succeed provided we have created folder with same name and not different name. The merge will succeed only if you try to merge data between public folder mailboxes and not between public folder mailbox and normal user mailbox.

#  For auditing purpose you can deploy a test environment where you can create the required set of the public folders whose data you wish to merge and then restore the database to recovery database and merge those specific folders.

2. Is there any way to browse and restore item-level content in a public folder in RDB so that we don't have to restore the whole folder?

Answer : No there is no way to browse or restore individual items in a public folder in RDB.

3. Is there any way to restore public folder in RDB to a normal mailbox or PST file?

Answer : No, if you try to merge the contents from a public folder mailbox to normal mailbox it will error out as  "cannot restore the content from public folder mailbox to a private mailbox"

Also you cannot use the New-MailboxExportRequest to export the data to the PST file. it will error out saying " 'Pf mailbox name' is a public folder mailbox and exporting to the PST file from a public folder mailbox is not allowed"

# It is still possible to use the outlook to extract the PST for the required public folder from the production public folder mailbox.

I hope the above clarifies your doubts!

Not applicable

one question, what does that mean?

restore the entire database where this p f mailbox was on?

"Recovering the public folder hierarchy structure would be only possible if you restore the database directly to the production or use the dial tone recovery method to recover the public folder hierarchy."

if that's the case then a best practice would be to place these or this primary one on its own database?

Not applicable

@ itworkedinthelab   : If at all the Mailbox database which is holding the Primary hierarchy mailbox needs to be recovered, then you will have to restore the entire database directly in the production database path as we are recovering the hierarchy of the Public folders! Restoring it to Recovery database will not get the hierarchy back as hierarchy CANNOT be merged to production database if it is mounted with new fresh database files.

As you are recovering the database, any folder content which was modified, deleted or created after the backup of that database was taken might be lost. Once the database is restored and mounted the first thing that happens is that the primary hierarchy mailbox will initiate full hierarchy sync with all the secondary hierarchy mailboxes and only the hierarchy present from that last restored backup will be available

I hope the above answers your question!

Not applicable

thanks for clearing it up

so like I thought since we cannot merge stuff like other public folder mailbox stuff

we need to restore this mailbox as "whole" and only was to do it is full restore of that db that holds that.

just one more thing(my memory might be failing here:)) don't we have only one public folder mailbox in charge of hierarchy in exchange 2013(writable I mean) so in that case we probably want to put that one in its own db just to make sure it doesn't affect anything else if it even needs to be restored(I know its a rare case retention and all but still)?

Not applicable

@itworkedinthelab :

Well there is no such rule / recommendation which says you need to have a reserved database for the Primary public folder mailboxes.  it is always possible to have a single database reserved for the primary hierarchy mailbox if you want!.

Recommendation will be to use the DAG for much needed high availability!

Not applicable

DAG sounds good as a general recommendation for public folder mailbox high availability

but since this one mailbox requires specific attention it would be a shame to restore it and other mailbox in the same db if somewhere where to happen.

but then if you prepare for the worse maybe nothing should happen(retention protect from accidental delete...)

Not applicable

@Siddhesh: Thank you very much for the answer.

But it seems it's quite inconvenient to restore public folder items in Exchange 2013. If I need to audit and view the items in a public folder backup, I have to create a separate test environment, recreate the folder list (a very hard task to do so...), and then restore the whole public folder to a live db?

It there any way we can at least do the same thing in Exchange 2010: restore a public folder database as a live db, and disable the replication of that database, so that the content in that "restored" db won't affect other production dbs. Then we can access the item-level contents in the db with MAPI. This solution avoids the need to recreate the folders first and a separate Exchange environment.

Version history
Last update:
‎Jul 01 2019 04:16 PM
Updated by: