Share via

Updating Calendar Permissions using PowerShell

Anonymous
2022-03-04T19:10:13+00:00

I am attempting to update a users calendar permissions via PowerShell but the syntax is giving me issues. The script below works if the calendar name is only 1 word but for 2 words it gives me an error:

add-mailboxfolderpermission -identity 'XXXXX1@XXXXX:\calendar' -user XXXXX2@XXXXX -accessrights editor

For example, If the calendar is named "Team Calendar" and I type that in, I get this error:

PS C:\WINDOWS\system32> add-mailboxfolderpermission -identity XXXXX1@XXXXX:\Team Calendar -user XXXXX2@XXXXX -accessrights editor

A positional parameter cannot be found that accepts argument 'Calendar'.

+ CategoryInfo          : InvalidArgument: (:) [Add-MailboxFolderPermission], ParameterBindingException 

+ FullyQualifiedErrorId : PositionalParameterNotFound,Add-MailboxFolderPermission 

+ PSComputerName        : outlook.office365.com

If I try to add quotes around the 2 words or any part of that string, I get this error:

PS C:\WINDOWS\system32> add-mailboxfolderpermission -identity XXXXX1@XXXXX:"Team Calendar" -user XXXXX2@XXXXX -accessrights editor

The operation couldn't be performed because 'XXXXX1@XXXXX:\Team Calendar' couldn't be found.

+ CategoryInfo          : NotSpecified: (:) [Add-MailboxFolderPermission], ManagementObjectNotFoundException 

+ FullyQualifiedErrorId : [Server=DM6PR11MB2731,RequestId=100737f6-8cd4-4ecb-8be3-8f1dca2180a1,TimeStamp=3/4/2022 7:06:45 PM] [FailureCategory=Cmdlet-ManagementObjectNotFoundException] E9033B60,Microsoft.Exchange.Management.StoreTasks.AddMailboxFolderPermission 

+ PSComputerName        : outlook.office365.com
Outlook | Windows | Classic Outlook for Windows | For home

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-03-04T21:04:21+00:00

    Hi Donnie,

    Greetings

    Welcome to Microsoft Community.

    I checked the errors you are getting and it shows that the PowerShell cannot accept the 2 word name in this instance as you can see in the errors “A positional parameter cannot be found that accepts argument 'Calendar'” and “The operation couldn't be performed because 'XXXXX1@XXXXX:\Team Calendar' couldn't be found”. I tried to find if there is a fix and I could not find any. In this case I advise you can change the name before running PowerShell or you can update the permission manually.

    If you have further inquiries on this matter, please feel free to ask by replying to this post.

    Your kind understanding is highly appreciated.

    Kind regards,

    Simbarashe

    Was this answer helpful?

    0 comments No comments