As an Exchange Online admin users may ask of you to delegate access to their calendar.
Unfortunately this can’t be done via the Exchange Admin Center. It’s one of many tasks that require PowerShell.
This small guide will show you three easy steps to delegate access to a user’s calendar using PowerShell by changing calendar permissions.
1. Connect to Exchange Online using PowerShell
Use an Exchange Online Remote Session (no module installation required) or use the EXO V2 module (supports MFA).
This sample code shows how to use the Exchange Online Remote Session:
- $Credentials = Get-Credential
- $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Credentials -Authentication Basic -AllowRedirection
- Import-PSSession $Session -DisableNameChecking
For complete details on how to connect to Exchange Online with PowerShell read Connect to Office 365 – PowerShell.
2. Check Existing Calendar Permissions
Before configuring calendar sharing on a mailbox you should check the existing permissions.
Use the following command to list the calendar permissions (substitute username with actual user name):
- Get-MailboxFolderPermission username:\calendar
Sample output from this command may look like this:
The reason you should check existing settings is that you need to use different commands depending on whether you’re updating existing permissions or setting new permissions.
3. Configure Mailbox Sharing
If the user or group to which you are delegating rights already has rights on the calendar you must use the Set-MailboxFolderPermission command.
If e.g. you want to change the rights assigned to Default from AvailabilityOnly to LimitedDetails use the following command:
- Set-MailboxFolderPermission tycho.brahe:\calendar -User Default -AccessRights LimitedDetails
On the other hand, if you’re assigning new permissions on the calendar you must use the Add-MailboxFolderPermission command.
If .e.g. you want to grant the user Hans.Schjellerup the Editor right on the calendar of user Tycho.Brahe use the following command:
- Add-MailboxFolderPermission tycho.brahe:\calendar -User Hans.Schjellerup -AccessRights Editor
After running the two above commands on the calendar of user Tycho.Brahe the configuration should now look something like this: