ReadOnly permission to multiple mailboxes

Austin Sundar 436 Reputation points
2020-11-04T15:02:54.63+00:00

Hi,
I am trying to apply read only permission to 500 mailboxes. I am using the bellow script to apply the permission.
.\ReadOnly_Permission.ps1 -Mailbox Test@test .com -User Test -Access reviewer

Can anyone help me figure out how to apply permission for all 500 users? Does the script below work?
Import-csv “”| {.\ReadOnly_Permission.ps1 -Mailbox $.mbx -User $.user -Access reviewer
}37497-capture.png
37496-readonly-permission.txt

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,626 questions
0 comments No comments
{count} votes

Accepted answer
  1. KyleXu-MSFT 26,261 Reputation points
    2020-11-05T06:15:38.097+00:00

    @Austin Sundar
    You can take step below to running script for multiple mailboxes:

    1. Put CSV file and script in the same folder.
      37555-qa-kyle-1105140747.png
    2. Create a new .PS1 file contains script below: $users = Import-Csv c:/temp/users.csv
       foreach ($user in $users){  
           .\ReadOnly_Permission.ps1 -Mailbox $user.mailbox -User $user.user -Access reviewer  
       }  
      

    37539-qa-kyle-1105141328.png
    3) Switch EMS to this folder location and running the second script:
    37632-qa-kyle-1105141457.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.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.