Hi Experts i have a shared mailbox and i want to give full access and send as permissions to 50 users, i want to use the below syntax please correct me.
For sendas permissions how can i suppress the below confirmation message
Confirm
Are you sure you want to perform this action?
Adding recipient permission 'SendAs' for user or group 'user1@contoso.com' on recipient 'sharedmailbox@contoso.com'.
Below is my csv file
Users
user1@contoso.com
user2@contoso.com
$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
}
in case if i need to remove the access is the below syntax correct and how do i suppress the confirmation message.
$UserList = import-csv C:\temp\list.csv
ForEach ($User in $UserList)
{
Remove-MailboxPermission -Identity sharedmailbox@contoso.com -User $user.Users -AccessRights FullAccess
Remove-RecipientPermission sharedmailbox@contoso.com -AccessRights SendAs -Trustee $user.Users
}