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.
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".