Monday, March 09, 2015

Office 365 mail enabling public folders #Office365 #MailEnabled #PublicFolders

I'm about to publish details of a bug we encountered (and bypassed) with mail enabled public folders in Office 365, but thought a quick post on how it's done might be useful.

You can create the public folder in the Exchange interface and create the folders, but they will not be mail enabled until you do the following:

1. Enable the mail address (either by the GUI or through PowerShell)
2. Set the email address (either by the GUI or through PowerShell)
3. Disable the Address Policy
4. Most importantly (and only via PowerShell as far I can see), enable Anonymous users to Create Items in the folder (otherwise incoming emails cannot reside in the Public Folder).

The code to do this is straightforward, and turned into a script so that it is repeatable in the event of any changes in your plans (and also why do repetitive tasks in the GUI, when one script will do it all?!)

This line of PowerShell will enable Anonymous Create Item rights:
Get-PublicFolder “” | Add-PublicFolderClientPermission -User Anonymous -AccessRights “CreateItems"



This line does the mail enabling, setting the address, and blocking Address Policy Enabling all in one go:
Set-MailPublicFolder "” -EmailAddressPolicyEnabled $false -PrimarySmtpAddress “"








Note that the full path to the public folder is the folder heirarchy so something like this for a folder 3 levels down a tree called "Fred"
“\Root Folder Name\Second Level Folder Level\Fred”
and the Public Folder Name in this instance is just
"Fred"

So, if the fred PF alias was fred@contoso.com your two lines of code would be:
Get-PublicFolder “\Root Folder Name\Second Level Folder Level\Fred” | Add-PublicFolderClientPermission -User Anonymous -AccessRights “CreateItems"
Set-MailPublicFolder "Fred” -EmailAddressPolicyEnabled $false -PrimarySmtpAddress “fred@contoso.com"



My thanks to the following 2 blog entries for pointing the direction:
Exchangepedia Blog
TechNet


NB. use the code at your own discretion and please note that this was done in a single Public Folder Mailbox environment.

No comments: