Created
August 8, 2020 10:53
-
-
Save michevnew/ddc527abcbf8ab13ff176b2532ecdc25 to your computer and use it in GitHub Desktop.
Add folder level permissions on all folders in a given mailbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$mailbox = "shared@domain.com" | |
$folders = Get-MailboxFolderStatistics $mailbox | ? {$_.FolderType -ne “Root” -and $_.FolderType -ne “Recoverableitemsroot” -and $_.FolderType -ne “Audits” -and $_.FolderType -ne “CalendarLogging” -and $_.FolderType -ne “RecoverableItemsDeletions” -and $_.FolderType -ne “RecoverableItemspurges” -and $_.FolderType -ne “RecoverableItemsversions”} | |
Add-MailboxFolderPermission $mailbox -User user@domain.com -AccessRights Reviewer #root permissions | |
foreach ($folder in $folders) { | |
$FolderPath = $folder.FolderPath.Replace("/","\").Replace([char]63743,"/") #with PowerShell v3 'fix' | |
$MailboxFolder = "$mailbox`:$FolderPath" | |
Add-MailboxFolderPermission "$MailboxFolder" -User user@domain.com -AccessRights Reviewer | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment