Create a new public folder in Office 365 using Powershell

Public folders are used to share information and collaborate with other people in your organization. Once the admin enables public folders they are automatically shown in all users’ Outlook client. The content is organized in a hierarchy which makes browsing very easier for users.

Things To Know Before Proceed

  • Public folder content can include email messages, posts, documents, and eForms.
  • Public folder architecture uses specially designed mailboxes (Public folder mailbox) to store both the public folder hierarchy (folder structure) and the content.
  • Before creating a public folder, you must first create a public folder mailbox.
  • There are two types of public folder mailboxes: the primary hierarchy mailbox and secondary hierarchy mailboxes. Both types of mailboxes can contain content.
  • Primary hierarchy mailbox: The first public folder mailbox you create will be the primary hierarchy mailbox in your organization. This is the only mailbox containing a writable (read/write) copy of the public folder structure. The public folder hierarchy is copied to all other public folder mailboxes, but these will be read-only copies.
  • Secondary hierarchy mailboxes: Any additional public folder mailboxes you create will be secondary mailboxes. The secondary hierarchy mailboxes contain public folder content and a read-only copy of the public folder hierarchy.

Create a new public folder mailbox using Powershell

We can use the New-Mailbox cmdlet to create a public folder mailbox. Before proceed run the below commands to connect Exchange Online (EXO) powershell.

$365Logon = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $365Logon -Authentication Basic -AllowRedirection
Import-PSSession $Session

The first mailbox you create will be the primary hierarchy mailbox in your organization.

New-Mailbox -PublicFolder -Name "Master-PFM"

Once you created a public folder mailbox (primary), any additional public folder mailboxes you create will be secondary mailboxes.

New-Mailbox -PublicFolder -Name "PFM2"

You can get your primary public folder mailbox by running the following command.

Get-OrganizationConfig | Format-List RootPublicFolderMailbox

Create a new public folder using Powershell

Once you created required public folder mailbox, you can use the New-PublicFolder cmdlet to create a public folder. The below command creates the public folder Support in the root of the public folder.

New-PublicFolder -Name "Support"

The below command creates the public folder Product1 under the existing folder Support.

New-PublicFolder -Name "Product1" -Path "Support"

The below command creates the public folder FAQs under the existing folder SupportProduct1.

New-PublicFolder -Name "FAQs" -Path "SupportProduct1"

The below command creates the public folder Marketing in the specific mailbox PFM2.

New-PublicFolder -Name "Marketing" -Mailbox "PFM2"

Advertisement

Leave a Comment