PowerShell Tutorial - Managing 365 Calendar Permissions

A regular request I get through our helpdesk is to add, remove, or amend permissions for users to see and edit calendars. This can be done from their machines via Outlook, but is much easier to action remotely using PowerShell, especially if you manage multiple tenants on 365.

This tutorial will walk you through the steps for each of these scenarios.

You must have PowerShell 5.1 or above installed, as well as the ExchangeOnlineManagement Module

(This can be installed by running Install-Module -Name ExchangeOnlineManagement in an elevated PowerShell window)

Getting Started - Connect To The Tenant

Each of the below sections assume you are already connected to the 365 tenant you wish to make changes to.

To connect to a tenant, run the following in PowerShell:

Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline -DelegatedOrganization primarydomainnamehere.com

Adding Mailbox Calendar Permissions

To grant a user permissions for a mailbox calendar, run the following in PowerShell, replacing the username and permissionlevel placeholders with the correct values:

Add-MailboxFolderPermission -Identity 'username:\Calendar' -User 'username' -AccessRights permissionlevel

Note that this may error if the user has already been granted permission to that calendar. In this case, you can run the following to find out what permissions are already assigned to the Calendar:

Get-MailboxFolderPermission -Identity 'username:\Calendar'

Modifying Mailbox Calendar Permissions

If the user has already been assigned permissions to a calendar, but you now need to change those permissions, then you can run the following in PowerShell:

Set-MailboxFolderPermission -Identity 'username:\Calendar' -User 'username' -AccessRights permissionlevel

This will override any previous permissions that the user had for that calendar with the permissions you specify.

Removing Mailbox Calendar Permissions

Finally, you may be asked to remove a users access to a calendar all together. In this case, you would run the following in PowerShell:

Remove-MailboxFolderPermission -Identity 'username:\Calendar' -User 'username'

💡
Changes to mailbox permissions can take some time to filter through to the end user. For this reason, I usually advise them that it can take up to an hour for them to see any changes.