Skip to content

Instantly share code, notes, and snippets.

@dbirks
Last active January 4, 2023 12:31
Show Gist options
  • Save dbirks/61ebfaad41dc36b23fb4eb1bf7d53ea2 to your computer and use it in GitHub Desktop.
Save dbirks/61ebfaad41dc36b23fb4eb1bf7d53ea2 to your computer and use it in GitHub Desktop.
Give a user access recursively to another mailbox's folders

Give a user access recursively to another mailbox's folders

I was running into a problem giving a user access to another user's mailbox, where the user was only getting permission to view the top level folders, while the subfolders had no viewing permissions set on them.

Here's the way to set permissions on each folder recursively if all else fails.

In this example, we are giving Mike editor privileges on Kukuri's mailbox folders.

ForEach($f in (Get-MailboxFolderStatistics kukuri@company.com | Where { $_.FolderPath.Contains("/") -eq $True } ) ) {
    $fname = "[email protected]:" + $f.FolderPath.Replace("/","\"); Add-MailboxFolderPermission $fname -User mike@company.com -AccessRights Editor
    Write-Host $fname
    Start-Sleep -Milliseconds 1000
}

Source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment