shared mailbox full access

Glenn Maxwell 10,146 Reputation points
2020-08-12T15:53:14.86+00:00

Hi Experts

i have a csv file in the below format, i want to import this csv file and provide full access to the shared mailbox, will the below syntax work for me.

Users
user1
user2
user3

$UserList = import-CSV C:\list.csv
ForEach ($User in $UserList){Set-Mailbox -Identity SharedMailbox@Company portal .com -User $user.name -AccessRights FullAccess -InheritanceType All -AutoMapping $True }

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,211 questions
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,369 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 96,161 Reputation points MVP
    2020-08-12T16:31:50.51+00:00

    Mate, instead of posting a dozen of such questions every week, try using the -WhatIf switch for once :)

    And no, it will not work, as you do not have a column "Name" in your CSV file, thus $user.name will be empty. Use $user instead.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. KyleXu-MSFT 26,211 Reputation points
    2020-08-13T07:55:54.717+00:00

    You need to use "$user.Users".
    As michev said, I also suggest you try run script with a little users first, if there exist any issue, it will show in the result directly. You could modify your script with the error message, you can also post script and error message on this forum, it will could help other users to correct your script.

    0 comments No comments