Create Exchange public folder mailbox PowerShell

I’ve set up public folder mailboxes in Exchange more times than I care to count—mostly for legacy compatibility or shared calendars that refuse to die. If you’re still managing Exchange (on-prem or hybrid), you know public folders aren’t going anywhere just yet. And while the GUI gets the job done, PowerShell is where I always end up—especially when I need precision or I’m working remotely.

Here’s how I typically roll through the setup, with a few quirks and gotchas I’ve hit along the way.

Why I Went with PowerShell for This

Not gonna lie, I used to avoid PowerShell for mailbox tasks unless absolutely necessary. But once I started managing Exchange Online across multiple tenants, the GUI just couldn’t keep up. PowerShell gave me speed, repeatability, and fewer surprises—well, most of the time.

In this case, I needed to spin up a public folder mailbox for a team that still relies on folder-based access to shared HR docs. No fancy SharePoint setup, just good old folders.

Step-by-Step Walkthrough (With Commentary)

Step 1: Check Your Permissions

Before anything, make sure your account has the right roles. I’ve been burned by missing permissions more than once—especially in hybrid setups where RBAC doesn’t always sync cleanly. Use Get-ManagementRoleAssignment if you’re unsure.

Step 2: Connect to Exchange

If you’re on-prem, launch Exchange Management Shell. For Exchange Online, I usually run:Connect-ExchangeOnline

I’ve had better luck using the newer Exchange Online PowerShell module (v2) for smoother authentication.

Step 3: Create the Public Folder Mailbox

Here’s the command I used to create the primary mailbox:

New-Mailbox -Name PF-01 -PublicFolder

This mailbox becomes the writable root of your public folder hierarchy. If you’re planning to add secondary mailboxes later for load balancing, make sure this one’s in place first.

Step 4: Verify the Mailbox

I always double-check with:

Get-Mailbox -PublicFolder
Get-OrganizationConfig | Select RootPublicFolderMailbox

The second command confirms which mailbox holds the writable hierarchy. If it’s blank, something went sideways.

Step 5: Create a Public Folder

To create a folder named “HR Services” at the root:

New-PublicFolder -Name "HR Services" -Path "\"

Note: That -Path "\" part is easy to miss. I’ve spent way too long debugging folder placement because I forgot it.

Step 6: Confirm It’s There

Run:

Get-PublicFolder -Recurse

This gives you a tree view of all folders. If “HR Services” doesn’t show up, check your path or permissions.

Bugs, Quirks, and Lessons Learned

  • On one tenant, the mailbox creation succeeded but didn’t register as the root. Had to manually set it using Set-OrganizationConfig.
  • If you’re scripting this for multiple tenants, add a delay between mailbox creation and folder creation. Sometimes the hierarchy isn’t ready instantly.
  • I’ve had folders vanish from view due to Outlook cache issues. Clearing the cache or switching to OWA usually confirms they’re actually there.

Final Thoughts

Setting up public folder mailboxes isn’t glamorous, but it’s still relevant—especially in environments where legacy workflows persist. PowerShell makes it bearable, and once you’ve got the hierarchy sorted, the rest is mostly smooth sailing.

If you’re testing this in a dev tenant or lab, make sure you’ve got a clean RBAC setup and that you’re not mixing up primary and secondary mailboxes. That’s where most of the confusion creeps in.

Ever had a public folder setup go sideways? Or maybe you’ve migrated away from them entirely? Drop a comment or share your setup quirks—I’m always curious how others are handling this in 2025.

PShivkumar

About the author: PShivkumar

With over 12 years of experience in IT and multiple certifications from Microsoft, our creator brings deep expertise in Exchange Server, Exchange Online, Windows OS, Teams, SharePoint, and virtualization. Scenario‑first guidance shaped by real incidents and recoveries Clear, actionable breakdowns of complex Microsoft ecosystems Focus on practicality, reliability, and repeatable workflows Whether supporting Microsoft technologies—server, client, or cloud—his work blends precision with creativity, making complex concepts accessible, practical, and engaging for professionals across the IT spectrum.

View all posts →

Comments

📝 Leave a Comment