DistributionGroup permissions

Roger Roger 6,671 Reputation points
2024-10-12T08:26:58.3966667+00:00

Hi All

i have a DL in Exchange online, lets say DL1@contoso.com. i have users list in csv file in the below format.i want to import the csv file and provide users Send As/Send Onbehalf permission to the DL. Please let me know if the below syntax is correct.

users
user1@contoso.com
user2@contoso.com

$users = Import-Csv -Path "c:\temp\input.csv"
foreach ($user in $users) {
    Add-RecipientPermission -Identity DL1@contoso.com -Trustee $user.users -AccessRights SendAs
     Set-Mailbox -Identity DL1@contoso.com -GrantSendOnBehalfTo @{Add=$user.users}
}

Microsoft Exchange Online
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,658 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,725 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
2,178 questions
{count} votes

Accepted answer
  1. Alex Zhang-MSFT 3,155 Reputation points Microsoft Vendor
    2024-10-14T07:13:09.9966667+00:00

    Hello, @Roger Roger,

    Welcome to the Microsoft Q&A platform!

    If you need to add permissions for a large number of users at the same time, I have tested the command you provided and it does what you need. If you encounter any other issues, you can provide the error code and screenshots, which will help to resolve your issue more efficiently.User's image

    User's image User's image

    If you don't have many users that you need to assign permissions to, I suggest you do it directly in EAC, it will be easier and faster. Here are the steps to provide users with Send As/Send On behalf permissions to the DL in EAC.

    1.Log in to EAC and click Recipients>Groups>Distribution List.

    2.Click on the target DL and select Settings>Edit manage delegates.

    3.Add delegates for the target users according to your requirements.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Thank you for your support and understanding.

    Best Wishes,

    Alex Zhang


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.