unified group permissions

Glenn Maxwell 11,496 Reputation points
2024-10-28T07:01:36.3766667+00:00

Hi All

i have a unified group lets say ug1@contoso.com. i want to provide few users send as and send on behalf permissions to the unified group. Please guide me with the PowerShell syntax. i have a csv file in the below format.

users 
user1@contoso.com  
user2@contoso.com

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,571 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,662 questions
Microsoft Exchange
Microsoft Exchange
Microsoft messaging and collaboration software.
561 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,132 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Xintao Qiao-MSFT 3,695 Reputation points Microsoft Vendor
    2024-10-28T08:04:08.45+00:00

    Hi, @Glenn Maxwell

    From your description, I understand that you want to assign Send As and Send on Behalf permissions to multiple users for a unified group.

    You can try the following syntax:

    # Import the CSV file
    $users = Import-Csv -Path "C:\Users\test.csv"
     
    # Grant Send As permission
    foreach ($user in $users) {
        Add-RecipientPermission -Identity "ug1@contoso.com" -AccessRights SendAs -Trustee $user.UserPrincipalName
    }
     
    # Grant Send on Behalf permission
    foreach ($user in $users) {
        Set-UnifiedGroup -Identity "ug1@contoso.com" -GrantSendOnBehalfTo $user.UserPrincipalName
    }
    

    Here are the test results.

    User's image

    User's image

    It should be noted that: If a user has both Send as and Send on behalf permissions to a mailbox or group, the Send as permission is always used.


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


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.