Thursday, July 16, 2015

Proper Syntex to change public folder permissions recursive using powershell.

It took me enough google searches to figure this out that I decided to post it here.  The issues seemed to be around the 'space' in the folder name.

Change directories to \Program Files\Exchange Server\Scripts

To add a user to a public folder and all subfolders in powershell use-
\AddUsersToPFRecursive.ps1 -Server "ExchangeServer" -TopPublicFolder "\Sales Folder" -User "JSmith" -Permissions

You can also do this if you want to add them to ALL public folders.
\AddUsersToPFRecursive.ps1 -Server "ExchangeServer" -TopPublicFolder "\" -User "JSmith" -Permissions

To REPLACE their permissions (say they have read access but you want them to have publishing editor), do this-
.\ReplaceUserPermissionOnPFRecursive.ps1 -Server "ExchangeServer" -TopPublicFolder "'\Sales Folder'" -User "JSmith" -Permissions PublishingEditor

Note- the folder is in both quote (") and with a tick (') around it.  It doesn't work with just quotes.

No comments:

Post a Comment