Inbox Subfolder Access Via Powershell (Exchange 2010)
In this example we will give USER2 access to USER1’s inbox and all subfolders.
First off I did the following command which gave USER2 inbox access to USER1’s mailbox (note this only gave inbox access it did not give access to subfolders under inbox)
ForEach($f in (Get-MailboxFolderStatistics USER1 | Where { $_.FolderPath.Contains(“/Inbox”) -eq $True } ) ) {$fname = “USER1:” + $f.FolderPath.Replace(“/”,””);Add-MailboxFolderPermission $fname -User USER2 -AccessRights Editor}
One thing to note with this command if the user has a slash ( / ) in the folder name it will fail on that folder.
Very useful, thank you!
Just add a second .Replace([char]63743,"/") after the first one. This fixes the issue with the "/" character in folder names.
Details here: http://www.tgvconsult.de/blog/4-geschichten-aus-dem-leben/19-exchange-2010-berechtigungen-in-postfachordnern-rekursiv-aendern-mit–im-ordnernamen.html
Solved a problem I've had with failed folder permssion inheritance which has had me stuck for a month!
Gets around the fact the 'get-mailboxfolder' only works on the mailbox of the logged-in user, which is pretty useless, really.
Thanks a million!
This comment has been removed by a blog administrator.
Exceedingly useful.
Makes up for the fact that 'get-mailboxfolder' only works on the mailbox of the logged-in User – which is pretty useless, really.
Fixed a problem of failed folder permission inheritance I've been struggling with for nearly a month!
Many thanks.