question

berket2020 avatar image
0 Votes"
berket2020 asked KyleXu-MSFT answered

Powershell script and csv file to grant full access and send as to multiple shared mailboxes

Hello

I need to assign multiple users permissions to multiple shared mailboxes.

I want to create a csv file and then import it into my powershell script.

What columns should i create for the csv? and what would the powershell script be for Full access and Send AS.

Thanks

office-exchange-server-administration
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KyleXu-MSFT avatar image
0 Votes"
KyleXu-MSFT answered

@berket2020

Please note that Exchange Q&A doesn't support scripting on demand so far. If you need a more professional script, you may need to open a ticket to Microsoft.

Here are my suggestion for you:

Prepare a CSV file like picture below(Title is "User" and "Shared"):
130066-qa-kyle-09-52-28.png

Then save the script below into a .ps1 file:

 $Mailboxes = import-csv C:\temp\users.csv
    
 foreach ($mailbox in $mailboxes) {
     Add-MailboxPermission -Identity $mailbox.shared -User $mailbox.user -AccessRights FullAccess -InheritanceType All
     Add-ADPermission -Identity $mailbox.shared -User $mailbox.user -ExtendedRights "Send As"  
 }

Run this script in EMS:
130072-qa-kyle-09-54-36.png


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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.