The Microsoft Windows PowerShell script below may be run with the Exchange Management Shell to automate the configuration of public folder permissions in Microsoft Exchange Server 2007. Additionally, you may modify the script by manually adding a list of public folders (which is included in the EXAMPLE section) to help with further automation of configuring public folder permissions.

<#
.SYNOPSIS
This script will apply access rights to a user for a public folder and it’s subfolders in Microsoft Exchange 2007.
.DESCRIPTION
This script will automate the process of applying access rights to a user for a public fodler and it’s subfolders in Microsoft Exchange 2007.
.EXAMPLE
Get-PublicFolder -Identity “\Departments\Accounting” -Recurse | Add-PublicFolderClientPermission -User $User -AccessRights $Access
Get-PublicFolder -Identity “\Departments\Information Technology” -Recurse | Add-PublicFolderClientPermission -User $User -AccessRights $Access
Get-PublicFolder -Identity “\Departments\Marketing” -Recurse | Add-PublicFolderClientPermission -User $User -AccessRights $Access
.AUTHOR
Written by Noel Enrique Alvarez on Thursday, March 24, 2016.
#>

#Request the Microsoft Exchange public folder
$Folder = Read-Host “What is the path to the Microsoft Exchange public folder?”

#Request the user’s Microsoft Active Directory display name
$User = Read-Host “What is the user’s Microsoft Active Directory display name?”

#Request the users access right
$Access = Read-Host “What access right should be applied to user (i.e. Editor)?”

#Configure the access right on the Microsoft Exchange Public Folder for the Microsoft Active Directory user
Get-PublicFolder –Identity $Folder –Recurse | Add-PublicFolderClientPermission –User $User –AccessRights $Access