I created the following script:
$ AllPublicFolders = Get-publicFolder '\ PF Test'-recurse
foreach ($ mp in $ AllPublicFolders) {
Get $ PublicFolderClientPermission-Pf | foreach {Add-PublicFolderClientPermission $ _.Identity-User $ Reviewer _.User-AccessRights-Confirm: $ False}
}
The problem is that PowerShell returns an error message saying that the user already has permission to read and can not assign the same right again.
User NT User:Domain\user, already has some of the permissions (ReadItems, FolderVisible) specified to be added
on the public folder \Teste PF\Teste Replicate 2\Teste Subfolder 2. You can't add a right that the user already has.
The current permission for NT User:Domain\user is "ReadItems, CreateItems, EditOwnedItems, DeleteOwnedItems, Ed
itAllItems, DeleteAllItems, CreateSubfolders, FolderOwner, FolderContact, FolderVisible".
+ CategoryInfo : InvalidArgument: (Microsoft.Excha...blicFolderEntry:PublicFolderEntry) [Add-PublicFolder
ClientPermission], InvalidOperationException
+ FullyQualifiedErrorId : 77A1D273,Microsoft.Exchange.Management.MapiTasks.AddPublicFolderClientPermission
The goal is to replace all the current permissions for the template Reviewer.