How to recreate Primary Hierarchy Public Folder Mailbox in Exchange 2013
Hi,
Sometimes, in our lab, developers delete Primary Public Folder Hierarchy Mailbox by mistake, and after it, we cannot perform any public folder operation via PF cmdlets.
E.g. a get-publicFolder cmd thows this error:
[PS] C:\Windows\system32>Get-PublicFolder \ -GetChildren Couldn't find the public folder mailbox. + CategoryInfo : NotSpecified: (:) [Get-PublicFolder], ObjectNotFoundException
Confirmation:
This is how I first confirm that ‘Primary Hierarchy Public Folder Mailbox’ has been deleted:
First I get the Primary Hierarchy PF mailbox using this command
Get-OrganizationConfig | FL RootPublicFolderMailbox
RootPublicFolderMailbox represents GUID of PF mailbox.
When I retrieved all PF Mailboxes, Guid of RootPublicFolderMailbox was not there:
Get-Mailbox –PublicFolder | FL Name,ExchangeGuid
which confirms that ‘Primary Hierarchy Public Folder Mailbox’ is no more in Exchange Server 2013, and someone has deleted it.
Recreation of Public Folder Hierarchy Mailbox:
The only way to recreate ‘Primary Hierarchy PF Mailbox’ I discovered via this helpful blog http://careexchange.in/how-to-recreate-public-folder-master-hierarchy-in-exchange-2013.
which is to remove all Public folders, all Secondary Public Folder Mailboxes, but I was not able to remove Public Folders and getting this error.
[PS] C:\Windows\system32> Get-PublicFolder -Recurse | Remove-PublicFolder Couldn't find the public folder mailbox. + CategoryInfo : NotSpecified: (:) [Get-PublicFolder], ObjectNotFoundException
So in the end, what I did was ‘Remove AD users associated with all Secondary PF Mailboxes using ‘Active Directory Users and Computers’ console.
For this, first I got the location of all secondary PF Mailboxes like this:
Get-Mailbox –PublicFolder | FL DistinguishedName
And then Removed the associated AD user using ADUC console, which subsequently disconnected all PF mailboxes.
Then I opened ADSIEdit.msc , and went to “Cn=Configuration” container, and browsed ‘Exchange Organization’ object’s properties, whose AD Path looks like this:
CN=OrganizationName,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=AdDomain,DC=lab
From properties of this object, I just cleared the value from the attribute ‘msExchDefaultPublicFolderMailbox’, which you can see is just a garbage.
Then I just re-created the Primary Hierarchy PF mailbox using this command:
New-Mailbox -PublicFolder -Name 'Primary Hierarchy PF Mailbox'
Then I recreated my secondary PF Mailboxes, and then created Public Folders.
Note: Please test this in a lab, before applying to production scenarios. Also, This doesnt recover existing Public folders.
12 Comments »
Leave a reply to exchangegeek Cancel reply
-
Recent
- How to recreate Primary Hierarchy Public Folder Mailbox in Exchange 2013
- How to log ‘Exchange Management Shell’ session in Exchange 2010\2013
- Cannot invoke pipeline because runspace is not in the Opened state
- Create Mailbox on Exchange Server 2013 using C#
- No snap-ins have been registered for Windows PowerShell version 3
- Send Email via PowerShell cmdlet Send-MailMessage
- 2010 in review
- How to remove client permissions from a public folder and all its children?
- How to remove all group memberships for one exchange mailbox user
- How to uninstall Exchange Server 2007
- How to set GAL for mailboxes in OWA for Exchange 2007/2010 in bulk
- Update Rollup 2 for Exchange Server 2010 (KB979611)
-
Links
-
Archives
- December 2013 (2)
- January 2013 (1)
- October 2012 (2)
- December 2011 (1)
- January 2011 (1)
- June 2010 (2)
- May 2010 (1)
- April 2010 (1)
- March 2010 (1)
- February 2010 (1)
- December 2008 (1)
-
Categories
-
RSS
Entries RSS
Comments RSS
Perfect!!!!! Thanks this worked
Comment by apinter | April 7, 2014 |
Glad that it worked for you. You are welcome.
Comment by exchangegeek | April 7, 2014 |
Works perfect! Thank you!
Comment by Patrick | October 8, 2015 |
Welcome. Pleased to know about it.
Comment by exchangegeek | October 8, 2015 |
Good.. helped me.
Comment by dellas | February 25, 2016 |
Glad to know.
Comment by exchangegeek | February 25, 2016 |
Deleting the users like U explained did the trick. Thanks!
Comment by Bernie | February 19, 2017 |
You are welcome. Glad that it helped you.
Comment by exchangegeek | February 19, 2017 |
we did this but still needed to get data out of the public folder. The mailboxes are still there besides attempting a full restore is there a way to re-attach a public folder to the public folder mailbox?
Comment by benzachary | January 5, 2018 |
Hi,
I already put a note at the end of my article that This doesnt recover existing Public folders.
Even then, did you try to connect disconnected mailboxes with AD user, to enable disconnected PF mailboxes?
I think there would be more than it to recover public folder data, but please give it a try.
Thanks,
Laeeq Qazi
Comment by exchangegeek | January 5, 2018 |
What happened to us was everything continued to work, the disabled user accounts are still there and the public folder mailboxes are still there. a few weeks later everything just disappeared (tombstone we assume). So now we have Public Folders under the new ‘primary heirarchy’ and Public Folder Mailboxes with data in them and user accounts. We ended up just restoring from backup back into the new hierarchy, but obviously the data was still there. I think what we could have done instead looking back was since the primary hierarchy account was deleted accidentally, we could have simply made one of the other secondary the primary which had the same copy of the data. By making a brand NEW hierarchy everything was disconnected. I hope that helps people who read this in the future as an optional fix without restoring. Thank you for your follow up and this article definitely helped us on solving the issue.
Comment by sup3rdup3r | January 7, 2018
You are welcome sup3rdup3r , glad that it helped you. And thanks for sharing your experience here.
Regards,
Laeeq
Comment by exchangegeek | January 10, 2018