Exchange Online: Viewing / Changing Calendar permissions for All Users

I come across this request a lot i.e. to view or change calendar permissions for all mailboxes. For e.g. UserA would like to have Publishing Editor rights on all mailboxes or UserA needs to be removed as publishing editor access off all mailboxes. Let’s assume that there are 100+ users to apply this to so doing it manually will be very cumbersome and lengthy process. We can use PowerShell to get it done much quicker. It can be very disastrous as well if wrong commands / syntax is used so you have to be very careful when setting some thing up using PowerShell.

You can always use -Whatif switch at the end of the Set command to see what it will do before you execute it.

Use the following command to check which mailboxes does UserA have calendar permissions on and what access rights.

Get-Mailbox | ForEach-Object {Get-MailboxFolderPermission $_”:\calendar”} | Where {$_.User -like “UserA”} | Select Identity, User, AccessRights

Following commands can be run to remove calendar permissions for UserA from all mailboxes. It will skip the mailboxes where UserA doesn’t have calendar rights on.

$mailboxes = (Get-Mailbox).primarysmtpaddress

foreach ($m in $mailboxes)

{Remove-MailboxFolderPermission -Identity “$($m):\calendar” -user “UserA” -whatif}

Above command will only tell you what will it do since -whatif switch is appended to the command. Once confirmed and you are happy to proceed just run the commands again with -whatif removed.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a website or blog at WordPress.com

Up ↑