Hi All
i have 10 users and i want to provide access to shared mailbox. i have the csv file in the below format. i am using exchange 2016 hybrid environment, some shared mailboxes are created onprem and migrated to cloud, some are remote shared mailboxes creating from onprem.
Users
user1@contoso.com
is the below syntax correct and in the below syntax is -Confirm:$false correct i get the confirmation Yes/No/A when adding manually, will -Confirm:$false take the option A
$UserList = import-csv C:\temp\list.csv
ForEach ($User in $UserList)
{
Add-MailboxPermission -Identity sharedmailbox@contoso.com -User $user.Users -AccessRights FullAccess -InheritanceType All -AutoMapping $True
Add-RecipientPermission sharedmailbox@contoso.com -AccessRights SendAs -Trustee $user.Users -Confirm:$false
Set-Mailbox -Identity sharedmailbox@contoso.com -GrantSendOnBehalfTo $user.Users -Confirm:$false
}