Tuesday, May 30, 2023

Public Folders – Modern

“Public Folders” – You cringed, again!! Well yes I agree as PF’s have been long the thorn in the Exchange Admins side. But they do have their usages and some users would tell you that their life depended on them, literally. When we get to the point of migration of these little nasties up to Office 365 well there are some trick involved.

Now, when I say “Modern” in the title here, then this is referring to Exchange 2013 and 2016. The earlier versions on Exchange 2007, 2010 are referred to as “Legacy”. Therefore if you need the “Legacy” version instead, these instructions are in a separate article under Public Folders so check that out.

Generally when we start an Office 365 migration we are not immediately thinking about Public Folders. This article will show you how to map the users that are migrated to Office 365 back to the On Premises version so they can continue to work as usual. Remember that Public Folders cannot co-exist on both systems, they will need to be in just one place or the other. The easiest way is to map the users back to the On Premises servers and deal with the migration of them later on.

For the full Microsoft version of what we are about to do then you can refer to this site.


What I am trying to do here instead is to provide a quick and simple walk through of the commands you actually need to run to get it going quickly and simply. If you don’t want all the fluff, then read on.

1. Download the Mail Enabled Public Folder Scripts from the Microsoft site and save them in C:\Scripts on your Exchange Server.


2. Because the Directory Sync mechanism doesn’t sync mail enabled public folders, that’s what these scripts are for. Run them on your Exchange Server like this.

Sync-MailPublicFolders.ps1 -Credential (Get-Credential) -CsvSummaryFile “<sync_summary.csv>”

3. On Exchange Online configure the Office 365 system to talk back through the hybrid server with this command.

Set-OrganizationConfig -PublicFoldersEnabled Remote -RemotePublicFolderMailboxes PFMailbox1,PFMailbox2,PFMailbox3

The references above for PFMailbox1 etc relate to the Public Folder Mailbox entries that you can find in the EAC on your On Premises Exchange servers. Put in all of the databases that you can find and it will map them through.

I do want to mention a small trap that is easy to fall into. It is possible to get the following error when you run the command above.

Looks pretty serious but is actually really simple. The problem is that the PFMailbox1 object in Active Directory lives in the “Users” OU. There is a real good chance that you may not be syncing that OU and therefore it can’t find it. So either move the object out, or sync “Users” and all will be well once it takes effect in Azure. Yes I spent a few hours working that little nugget out a while back, so you’re welcome!

And that is about it. In my experience it takes about an hour for the users in the Cloud to start seeing the Public Folders On Premises so don’t freak out when it is not immediately available. Just give it time and it will work out.

Previous article
Next article
Mark Rochester
Mark Rochesterhttps://thecloudgeezer.com
Mark currently works in the cloud space assisting large companies to migrate from either on premises to the cloud, or cloud to cloud. His experience with Enterprise migrations spans more than 25 years which basically makes him old. However, with all the oldness creeping up he still finds technology massively exciting. Please reach out for a chat anytime you would like. :-)

Related Articles


I am assuming that if you made it this far then you will already know a little bit around the importance of SPF, DKIM...

SharePoint Site/File Discovery Report

Getting a full list of every file in your organizations' Share Point environment can be difficult via the normal consoles and reports. What I...

Backup your Cloud Storage on a Local Drive

Having all your data in the cloud is a wonderful thing. BUT, sometimes you either want the peace of mind that you have a...

Stay Connected

- Advertisement -

Latest Articles