EXO Powershell, Lots of users, lots of calendars

Tom Dollow 25 Reputation points
2023-07-17T14:39:05.76+00:00

I have a hybrid setup at the moment, and for one reason or another [above my knowledge and ability] users in mail enabled security groups cannot "book" spaces in calendars on exo, until i manually apply calendar permissions in exo powershell; adding mail enabled security groups for calendar permissions doesnt work.

So I was trying to script the adding of mass users to each of the calendars:

$Usernames = import-csv c:\path to script\Usernames.csv

foreach ($name in $Usernames) {
        Add-MailboxFolderPermission -identity NameOfCalendar@domain.com:\Calendar -user $name -AccessRights Editor
    }

However, when i run this, i get the error below:

Write-ErrorMessage : Cannot process argument transformation on parameter 'User'. Cannot convert value "" to type "Microsoft.Exchange.Management.StoreTasks.MailboxFolderUserIdParameter". Error: "identity"
At C:\PATH TO USER\AppData\Local\Temp\tmpEXO_p3qndzjg.vmp\tmpEXO_p3qndzjg.vmp.psm1:1159 char:13
+             Write-ErrorMessage $ErrorObject
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-MailboxFolderPermission], ParameterTransformationException
    + FullyQualifiedErrorId : [Server=VI1PR07MB5294,RequestId=acd1f427-df1b-ebf4-9149-4a463639c4be,TimeStamp=Mon, 17 Jul 2023 14:27:17 GMT],Write-ErrorMessage

Thanks

Microsoft Exchange Online
0 comments No comments
{count} votes

Accepted answer
  1. Kael Yao-MSFT 37,676 Reputation points Microsoft Vendor
    2023-07-18T02:01:29.2666667+00:00

    Hi @Tom Dollow

    Would you please also post the Usernames.csv file?

    For example, if the format of this csv file looks like:

    01

    You may need to modify this row in the script.

    From:

    Add-MailboxFolderPermission -identity NameOfCalendar@domain.com:\Calendar -user $name -AccessRights Editor
    
    

    To:

    Add-MailboxFolderPermission -identity NameOfCalendar@domain.com:\Calendar -user $name.Email -AccessRights Editor
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful