anonymous user
The "-User" doesn't accept array, so you need to add permission one by one:
If you want to use one CSV file as source file, you need to change it into this format:
The you could use script below to create shared mailbox and add permission:
$Datas = import-csv d:/temp/shared.csv
foreach($Data in $Datas){
if((Get-Mailbox $data.name -erroraction 'silentlycontinue') -eq $null){
New-Mailbox -Name $data.Name -DisplayName $data.DisplayName -Shared
}
Add-MailboxPermission -Identity $data.Name -User $data.User -AccessRights $data.AccessRights
}
If the response is helpful, please click "Accept Answer" and upvote it.
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.