Microsoft has made it pretty clear in recent years that public folders will be going away at some stage in the future of Exchange Server.
If you’ve been using public folders in your Exchange organization and decided to get rid of them completely then you may run into this particular issue.
In this scenario I have gone ahead and prepared to remove the public folder database by:
- Removing all of the public folder content
- Ensured OAB distribution is set to web only
- Ensured all my clients are Outlook 2007 and above
When I attempt to remove the public folder database I receive this error.
The public folder database ‘PF-BR-01’ cannot be deleted.
Public folder database “PF-BR-01” is the default public folder database for the following mailbox database(s):
. Before deleting the public folder database, assign a new default public folder database to the mailbox database(s).
The solution seems logical. All I need to do is modify that mailbox database so it no longer uses the public folder database.
It is simple enough to change the public folder database configured for a mailbox database to some other public folder database, but in this situation I’m trying to get rid of public folders entirely. So instead I want to set the mailbox database to have no default public folder database.
Here is what happens if I try to use Set-MailboxDatabase to set the value to $null.
[PS] C:\>Set-MailboxDatabase MB-BR-01 -PublicFolderDatabase $null
Cannot validate argument on parameter 'PublicFolderDatabase'. The argument is null or empty. Supply an argument that is
not null or empty and then try the command again.
+ CategoryInfo : InvalidData: (:) [Set-MailboxDatabase], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Set-MailboxDatabase
It doesn’t work. However all is not lost, there is another way, using ADSIEdit.msc.
Open ADSIEdit.msc and connect to the Configuration naming context.
Navigate to the container that holds the Exchange databases. For Exchange 2010 you’ll find this in CN=Services -> CN=Microsoft Exchange -> CN=(your organization name) -> CN=Administrative Groups -> CN=Exchange Administrative Group (FYDIBOHF23SPDLT) -> CN=Databases.
Right-click the mailbox database you want to remove the default public folder database from and choose Properties.
Scroll down until you find the msExchHomePublicMDB attribute. Highlight it and then click Edit.
Click the Clear button so that the value changes to “not set”.
Click OK, and OK again to commit the change.
Depending on the size of your network you may need to wait for that change to replicate throughout your Active Directory.
When you try to remove the public folder database again you should find that it now removes without error.