I Need To Make A Change With My IT Support! Call (225) 706-8414

Update Office 365 Exchange Public Folder permissions using PowerShell

You need to update permissions on one or more Public Folders hosted on Office 365; for example, you’re getting NDRs sending to mail enabled public folders.


You can use the Add-PublicFolderClientPermission cmdlet to do this:

  1. Connect your PowerShell instance to O365
  2. Issue the following command:
    Add-PublicFolderClientPermission -Identity PathtoPF -User Anonymous -AccessRights ContributorThis will grant anonymous users Contributor rights (i.e. Create Items, Folder Visible).

If you get an error like “An existing permission entry was found for user: Anonymous.”, you can remove the permissions using Remove-PublicFolderClientPermissions, then repeat step above.


If you need to update the entire PF tree:

  1. Create a file with the following:
    function AddAnonPerms
       param (
          [string] $pf='',
          [string] $user="Anonymous",
          [string] $rights="Contributor"
       $children = Get-PublicFolder -Identity $pf -GetChildren
       $children | % {
             Remove-PublicFolderClientPermission -Identity $_.Identity -User $user -Confirm:$false
             Add-PublicFolderClientPermission -Identity $_.Identity -User $user -AccessRights $rights
             if ( $_.HasSubfolders )
                AddAnonPerms $_.Identity $user $rights;
  2. Source the new file:
    . /path/to/addanonperms.ps1
  3. Connect your PS session to O365
  4. Run the AddAnonPerms function.  By default, it starts at the root of the PF hierarchy and grants Anonymous users Contributor rights but the root, user, and permissions can be passed as arguments if needed.


Concerned About Cyber Attacks?


Want to Migrate to the Cloud?

Office 365

Ready to Experience Microsoft Office 365?

Want the latest IT news directly in your inbox? Subscribe now!