How to Set Calendar Permissions in Office 365/Exchange via PowerShell?

This is a tutorial on how to view, add and remove mailbox calendar permissions on Microsoft 365 (ex-Office-365) and on-premises Exchange Server via PowerShell. For example, you need to grant read permissions to the room mailbox calendar for a few users. You can grant room mailboxes calendar permissions for specific users or an AD security group. In most cases, you should assign calendar permissions to a security group. In this case, all you have to do is to grant access to the specific mailbox calendar to add the user to the Active Directory group (without changing mailbox calendar permissions via PowerShell).

By default, in Exchange Server organization and Microsoft 365 (Exchange Online) tenant users can’t view Outlook e-mails or calendar items of other users. The only permission that is provided to all users by default is the ability to view the Free/Busy information in other users’ calendars (this is the AvailabilityOnly role).

Users can independently grant the necessary permissions for Outlook mailbox folders and items to other users (from the Outlook/OWA interface). Unfortunately, in Exchange 2019/2016/2013 and Exchange Online (Office 365), the administrator cannot centrally manage calendar permissions from the GUI (Exchange MMC, EAC — Exchange Administration Center, or Microsoft 365 admin portal). However, you can use a built-in Add-MailboxFolderPermission cmdlet, which allows managing user permissions on any user’s mailbox folder from PowerShell (this cmdlet first appeared in Exchange Server 2010). This cmdlet is also supported in Microsoft 365 cloud tenants.

Connecting Microsoft 365/Exchange from PowerShell

First, you need to connect to your Microsoft 365 or on-premises Exchange tenant.

Connecting to Microsoft 365 (Exchange Online) tenant with PowerShell:

  1. Open the Windows PowerShell console;
  2. Check if the Exchange Online PowerShell V2 (EXO V2) is installed on the computer:
    Get-InstalledModule ExchangeOnlineManagement

    If the module is missing, you can install it from the PowerShell Online Gallery using the following command:

    Install-Module PowershellGet

    office 365 calendar permissions powershell

  3. Run the following command to connect to your Exchange Online tenant:
    Connect-ExchangeOnline -UserPrincipalName -ShowProgress $true

    calendar permissions powershell

By default, Microsoft Modern Authentication is used to sign in. Specify your Microsoft 365 tenant admin credentials. If you have MFA (Multi-Factor Authentication) enabled for your Azure account, you must confirm your account login with your second factor.

Connecting to On-premises Exchange Server Organization with PowerShell

You can remotely connect to your on-prem Exchange Server 2010, 2013, 2016, and 2019 using PowerShell (you do not need to install the Exchange Management Shell on your computer):

  1. Save your Exchange administrator’s credentials into the PowerShell variable:
    $LiveCred = Get-Credential
  2. Establish a remote PowerShell session with your Exchange Server:
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://<your-target-exchange-server-address>/powershell/ -Credential $LiveCred

Note. In our case when we tried to run the previous command to connect Exchange 2010 we’ve received an error:
[ny-msg-02] Connecting to remote server failed with the following error message:
The WinRM client cannot process the request. The WinRM client tried to use Negotiate authentication mechanism, but the destination computer (ny-msg-02:443) returned an ‘access denied’ error. Change the configuration to allow Negotiate authentication mechanism to be used or specify one of the authentication mechanisms supported by the server. To use Kerberos, specify the local computer name as the remote destination. Also, verify that the client computer and the destination computer are joined to a domain. To use Basic, specify the local computer name as the remote destination, specify Basic authentication and provide user name and password. Possible authentication mechanisms reported by the server.

  1. In our environment to connect to the target Exchange CAS server, we should use the HTTP connection (instead of HTTPS) and Kerberos authentication. The connection command should look like this:
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://ny-msg-02/powershell/ -Credential $LiveCred -Authentication Kerberos
  2. The next step is to import Exchange management commands from a remote computer to your PowerShell console:
    Import-PSSession $Session

Tip. It happens that when you run the Import-PSSession command, you can face an error:
Import-PSSession: Files cannot be loaded since running scripts has been disabled on this system. Provide a valid certificate with which to sign the files.

In this case, you need to allow script execution. Do this by setting the PowerShell Execution Policy value to RemoteSigned:

Set-ExecutionPolicy RemoteSigned

powershell calendar permissions
set calendar permissions powershell

Hint. If you logged in directly to the on-premises Exchange server, you can either start the Exchange Management Shell right away, or run a regular PowerShell.exe CLI, and load Exchange cmdlets with the command:

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn 

How to Get Mailbox Calendar Permissions Using PowerShell?

  • You can view current calendar (folder-level) permissions of the specified mailbox by using the Get-MailboxFolderPermission cmdlet (this cmdlet is available in the cloud-based service and in on-premises Exchange):

    FolderName User AccessRights SharingPermissionFlags
    ———- —- ———— ———————-
    Calendar Default {AvailabilityOnly}
    Calendar Anonymous {None}
    Calendar Alex {Reviewer}
    Calendar Henrietta {Editor}

  • Change the username to the user account you want to check calendar permissions for;

Hint. If, when executing the following commands, you’re facing an error:
Get-MailboxFolderPermission : The term ‘Get-MailboxFolderPermission’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
This means you did not complete the steps to connect to your Exchange/Microsoft 365 tenant and did not import PowerShell Exchange cmdlets into your session. Carefully read and follow the steps from the previous paragraph.

Note. If this command returns that ‘username:\calendar’ cannot be found, most likely the user has Outlook language settings other than English. Appropriately, the Calendar folder name can be different (calendar\kalender\calendario\calendrier\календарь). For example, to view calendar permissions for the Dutch Language (nl-NL) use the command:

Get-MailboxFolderPermission username:Agenda
  • You can get the name of the calendar in the current user’s language configuration with the command:
    (Get-MailboxFolderStatistics username -FolderScope Calendar).Identity

calendar permissions office 365 powershell

  • Check the current calendar permissions with the command:
    Get-MailboxFolderPermission brett.jackson:\calendar
  • As you can see, the default AvailabilityOnly role is assigned on a calendar folder only.

exchange online calendar permissions

  • You can get the list of all mailbox calendars permissions in your organization using the following command:
    Get-Mailbox | ForEach-Object {Get-MailboxFolderPermission $_”:\calendar”} | Where {$_.User -like “Default”} | Select Identity, User, AccessRights

    Tip. In on-premise Exchange, you can view a user’s calendar settings in a specific mailbox database using the following command:
    Get-Mailbox –database mbxdbname | ForEach-Object {get-MailboxFolderPermission $_”:\calendar”}

  • Change mbxdbname to the name of your Exchange mailbox database.

Using PowerShell, you can find all the calendars in your organization/tenant that a particular user has been granted access to. In this example we want to display a list of user mailboxes, calendars to which the user named Mueller has access:

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

add calendar permissions powershell

The list of users whose calendars the user can access are listed in the Identity column. The AccessRights field specifies the current calendar permissions.

Tip. You can use the Get-EXOMailboxFolderPermission cmdlet instead of Get-MailboxFolderPermission to view the permissions of mailbox items in the Exchange Online PowerShell V2 module.

Outlook: Calendar Permission Levels and Access Roles

When managing calendar and Outlook folder permissions, you can use the following built-in Exchange roles:

  • Owner — gives full control of the mailbox folder: read, create, modify, and delete all items and folders. Also, this role allows to manage item’s permissions;
  • PublishingEditor — read, create, modify, and delete items/subfolders (all permissions, except the right to change permissions);
  • Editor — read, create, modify, and delete items (can’t create subfolders);
  • PublishingAuthor — create, and read all items/subfolders. You can modify and delete only items you create;
  • Author — create and read items. Edit and delete own items;
  • NonEditingAuthor — full read access, and create items. You can delete only your own items;
  • Reviewer — read folder items only;
  • Contributor — create items and folders (can’t read items);
  • AvailabilityOnly — read Free/Busy info from the calendar;
  • LimitedDetails — view availability data with calendar item subject and location;
  • None — no permissions to access folder and files.

set calendar permissions powershell office 365

You can also use granular permissions to fine-tune the access rights to the mailbox calendar. The following values are available:

  • CreateItems;
  • CreateSubfolders;
  • DeleteAllItems;
  • DeleteOwnedItems;
  • EditAllItems;
  • EditOwnedItems;
  • FolderContact;
  • FolderOwner;
  • FolderVisible;
  • ReadItems.

The Permission Level roles described above are just a set of granular permissions. For example, the Editor role is a set of the following individual permissions: CreateItems, DeleteAllItems, DeleteOwnedItems, EditAllItems, EditOwnedItems, FolderVisible, ReadItems

These permissions can be set using the –AccessRights parameter of the Set-MailboxFolderPermission cmdlet.

How to Set Office 365/Exchange Calendar Permissions Using PowerShell?

  1. In order to grant user2 the permissions to view and edit user1 calendar items, run the following command:
    Add-MailboxFolderPermission -Identity\calendar -user -AccessRights Editor
  2. If some of the items in the calendar are marked as Private, you can allow delegating the permissions to view Private calendar items. Use the command:
    Add-MailboxFolderPermission –Identity\calendar –User -AccessRights Editor -SharingPermissionFlags Delegate,CanViewPrivateItems
  3. If you need to change the Default permissions for the calendar folder (to allow all organization users to view a calendar of the specified user), run the command:
    Set-MailboxFolderPermission -Identity\calendar -User Default -AccessRights Reviewer
  4. Check the current calendar permissions again using the Get-MailboxFolderPermissions cmdlet. They should change:
    Get-MailboxFolderPermission -Identity\calendar

    FolderName User AccessRights
    ———- —- ————
    Calendar Default {Reviewer}
    Calendar Anonymous {None}
    Calendar user2 {Editor}

  5. You can also grant permissions for the mailbox not to an individual user, but the Exchange distribution group:
    New-DistributionGroup -Type Security -Name “Resource Calendar Owners” -Alias “grResourceCalendarAccess”

    add-MailboxFolderPermission -Identity\calendar -User grResourceCalendarAccess -AccessRights Owner
  6. In some cases, you need to grant Reviewer permissions on a calendar folder in all user’s mailboxes in your Exchange organization. You can make this bulk calendar permissions change using a simple PowerShell script. To change the Default calendar permission for all mailboxes to Reviewer:
    foreach($usermbx in Get-Mailbox  -RecipientTypeDetails UserMailbox) {

    $usercalendar = $usermbx.alias+":\Calendar"

    Set-MailboxFolderPermission -Identity $usercalendar -User Default -AccessRights Reviewer

  7. Also, you can prepare a CSV file with a list of users, and assign them permissions to access a specific user’s calendar:
    Import-Csv users.csv | foreach { add-MailboxFolderPermission -Identity "\calendar" -User $_.alias -AccessRights Owner }

You can use the parameter SendNotificationToUser of the Set-MailboxFolderPermission cmdlet to generate a “share invitation” email that summarizes your changes. The option -SendNotificationToUser $true can be used only when you set one of the following permissions via the AccessRights parameter: AvailabilityOnly, LimitedDetails, Reviewer, or Editor. The following command will send a sharing invitation to the user2:

Add-MailboxFolderPermission -Identity\calendar -user -AccessRights Editor -SendNotificationToUser $true

This is what the sharing invitation will look like in Outlook:

You’re invited to share this calendar.
UserName has invited you to view his or her Calendar. Click the Open button above.

office 365 powershell calendar permissions

How to Add Shared Calendar in Outlook 2019/2016?

In order to view other calendars in Outlook 2019/2016 (including room resources, Shared calendars), you should switch to the calendar view and select the calendar type you want to add. You can select a user from Address Book (Global Address List – GAL), Open Shared Calendar (you should specify user name), Room List, and Internet (web-calendar).

add-mailboxfolderpermission calendar

For example, you want to add a calendar from the Global Address List. Find the calendar name you want to add to Outlook and click OK. The shared calendar should appear under the My Calendars in Shared Calendars section.

365 calendar permissions powershell

How to Remove and Reset Calendar Permissions via PowerShell?

  1. Use the Remove-MailboxFolderPermission cmdlet to remove the calendar permissions:
    Remove-MailboxFolderPermission -Identity\calendar –user
  2. If you want to reset user’s calendar permissions to default, then run:
    Get-MailboxFolderPermission brett.jackson:\Calendar | % { Remove-MailboxFolderPermission -Identity $_.Identity -User $_.User }
  3. To exclude some “default” permissions entries from the removing script, use the following PowerShell one-liner:
    Get-MailboxFolderPermission brett.jackson:\Calendar | ? {$_.User -notmatch "^(Default|Secretary|Anonymous)$"} | % { Remove-MailboxFolderPermission -Identity $_.Identity -User $_.User.ADRecipient.ExchangeObjectId.Guid -Confirm:$false }
  4. Now you can disconnect your PowerShell session from Microsoft 365/Exchange:
    Remove-PSSession $Session
Brian Jackson started this blog in 2011. Brian has a huge passion for WordPress and technology for over a decade. Brian enjoys blogging, movies, and hiking.


  1. I am getting the error that the [FailureCategory=Cmdlet-UserAlreadyExistsInPermissionEntryException]
    I am pretty sure they tried to setup sharing themselves and they have away/busy information only. Do you know of a way to change the permissions or remove them so I can add the PublishingEditor permissions they need?

  2. Thanks, this is very helpful! (Jason’s comment about Use Set-MailboxFolderPermission for existing users was also helpful.)

    A couple things to add:
    – “None” is also an available role
    – You can specify “Default” for the user parameter

  3. Great info

    Is it possible to use a group ( security / distribution ) to assign permissions rather than individual users ? We are looking at our resource calendars to do this on

    1. Hey, Daniel!

      Create new security distribution group:
      New-DistributionGroup -Type Security -Name “Access to Resource Calendars” -Alias “grResourceCalendAcess”
      And add users to this group.
      Grant permissions to resource calendar:
      add-MailboxFolderPermission -Identity user_name:Calendar -User grResourceCalendAcess -AccessRights Owner

  4. I get an error when trying Import-PSSession $Session. It says “The term ‘Import’ is not recognized as the name of a cmdlet…etc.”

    This is quite archaic. Is there no way to do this through the admin portal?

  5. Worked fantastically!

    If used in tandem with the PowerShell for Office 365 tool (which essentially has all of the modules built in and starts you at the domain admin login step) then it’s literally a one command job.

    Very awesome :)

  6. Getting the following error in step 7 when I run
    Get-Mailbox –database mbxdbname | ForEach-Object {Set-MailboxFolderPermission $_”:\calendar” -User Default -AccessRights Reviewer}

    I get:
    A parameter cannot be found that matches parameter name ‘database’.
    + CategoryInfo : InvalidArgument: (:) [Get-Mailbox], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Get-Mailbox
    + PSComputerName :

  7. I recieve and error about Get-MailboxFolderPermission username:\calendar.

    Get-MailboxFolderPermission : The term ‘Get-MailboxFolderPermission’
    is not recognized as the name of a cmdlet, function, script file, or
    operable program. Check the spelling of the name, or if a path was
    included, verify that the path is correct and try again.
    At line:1 char:1
    + Get-MailboxFolderPermission
    username:\calenda …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (Get-MailboxFolderPermis
    sion:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    Anyone else seeing this?


    1. Receiving the same error:
      A positional parameter cannot be found that accepts argument ‘Get-MailboxFolderPermission $_”:\calendar”’.
      + CategoryInfo : InvalidArgument: (:) [Get-Mailbox], ParameterBindingException
      + FullyQualifiedErrorId : PositionalParameterNotFound,Get-Mailbox
      + PSComputerName :

  8. Heyhey!
    For me it says for “username:\calendar” that it cannot be found… Just “username” is found. Any ideas how to access the calendar now? :(

  9. Hi all, i have read the comments and advise above and think that it will work. However, to me the remark was made that it should be possible to read someone else’s calender, but the items that are put in the calender and are marked as private should not be (or just be basic) visible to the person accessing the calender. Does “-AccessRights Reviewer” do that or do i need more? Our Personnel Officer needs access to the CEO’s calender except for the private items.

  10. Nice write-up, thanks for the help.

    1) I’d like to hear an answer to Paul’s question as well.

    2) Trying to see the default user calendar permissions throws an error for me. When I run this:
    ” Get-MailboxFolderPermission Default:\calendar”

    I get this:
    “The specified mailbox “Default” doesn’t exist.
    + CategoryInfo : NotSpecified: (:) [Get-MailboxFolderPermission], ManagementObjectNotFoundException
    + FullyQualifiedErrorId : [Server=BYAPR11MB3510,RequestId=929235a4-b9f6-4188-8fd1-2ea5ce344d0b,TimeStamp=7/8/2019 7:35:43 PM
    ] [FailureCategory=Cmdlet-ManagementObjectNotFoundException] F470BBDC,Microsoft.Exchange.Management.StoreTasks.GetMailboxFol
    + PSComputerName :”

  11. for you information
    Step 5. Viewing Current Calendar Permissions with PowerShell

    last script are CHANGING permissions not only viewing.

    Get-Mailbox –database mbxdbname | ForEach-Object {Set-MailboxFolderPermission $_”:\calendar” -User Default -AccessRights Reviewer}

  12. I would like to see if there is a way to change the calendar permissions for an entire group. Just like how you gave a group permissions, I want the group to be the object with the calendar.

  13. Hi
    I am struggle to find out how to allow one user to add user defined fields to another users calendar
    I have a COM integration that works fine for my own calendar but I cannot find any way to set for another user to set their permissions on their calendar to allow me to add the field
    I can create/update/delete appointments fine
    Specifically I need this to return an odd number
    But no matter what I try in the user interface I cannot get it to return anything other than 18 which is MAPI_ACCESS_READ+MAPI_ACCESS_CREATE_CONTENTS

  14. When running:

    > Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn

    I get the error:

    Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 5.
    At line:1 char:1
    + Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (Microsoft.Excha…werShell.SnapIn:String) [Add-PSSnapin], PSArgumentEx
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

  15. I keep getting an error for the Identity.
    Cannot process argument transformation on parameter ‘Identity’. Cannot convert value “” to type

  16. 1) DO NOT open PowerShell as Administrator as it makes no sense: local administrative permission doesn’t affect the remote system anyhow!
    2) Microsoft is going or already moved connection to the Modern Authentication, which requires these commands:
    Import-Module ExchangeOnlineManagement
    Connect-ExchangeOnline -UserPrincipalName -ShowProgress $true

  17. Thanks for the post, still a ton of useful info in here. Quick tip for others: If you want to identify which Calendars one individual user has access to, modify the command:
    Get-Mailbox | ForEach-Object {Get-MailboxFolderPermission $_”:calendar”} | Where {$_.User -like “Default”} | Select Identity, User, AccessRights

    Replacing “Default” with the name of the specific user for whom you want to identify permissions.

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

  18. Hello I’m getting this error, when trying to create a new session to 0365:

    New-PSSession : [] Connecting to remote server failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
    At line:1 char:12 + $Session = New-PSSession -ConfigurationName Microsoft.Exchange -Conne …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OpenError: (System.Manageme….RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin gTransportException + FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed
    Can you help?

  19. I know this is a random question, but if you have given someone calendar access and it’s not appearing for them – do you need to give them mailbox access as well? I didn’t think you did unless there has been a change in recent months?

  20. Probably a really dumb question but would I be able to share all the calendars of one security group with another? For instance could I do something like this?

    add-MailboxFolderPermission -Identity grResources:\calendar -User grResourceCalendarAccess -AccessRights Owner

    Essentially I’m looking only to share the calendars of a specific set of people with another specific set of people within a division.

Leave a Reply

Your email address will not be published.

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