PowerShell
Edit|Remove
$Mailboxlist = Import-Csv .\sendassgroups.csv 
foreach ($Mailbox in $Mailboxlist) {  
#Group with permissions to shared mailbox  
$Group = $Mailbox.User  
#Shared mailbox  
$Identity = $Mailbox.Identity  
#Get Group ID  
$ID = (Get-AzureADGroup -Filter "DisplayName eq '$Group'").ObjectId  
#Get groupmembers  
Get-AzureADGroupMember -ObjectId $ID | foreach-Object {   
#Write-Host "Added Send As Permission for " $_.UserPrincipalName" To " $Identity 
#Add Send As mailbox permission  
Add-RecipientPermission $Identity -AccessRights SendAs -Trustee $_.UserPrincipalName -Confirm:$false 
}  
}
 

 

This script wil add full access permissions to members of a group. Make a csv export with the following properties: Identity User AccessRights. The script wil use the csv to change the groupmembership to a user membership recursively for all group members.

 

CSV Example:

Identity Trustee AccessRights
Identity mailbox 1 Groupname 1 SendAs
Identity mailbox 2 Groupname 2 SendAs
Identity mailbox 3 Groupname 3 SendAs
Identity mailbox 4 Groupname 4 SendAs
Identity mailbox 5 Groupname 5 SendAs
Identity mailbox 6 Groupname 6 SendAs
Identity mailbox 7 Groupname 7 SendAs
Identity mailbox 8 Groupname 8 SendAs
Identity mailbox 9 Groupname 9 SendAs
Identity mailbox 10 Groupname 10 SendAs
Identity mailbox 11 Groupname 11 SendAs
Identity mailbox 12 Groupname 12 SendAs
Identity mailbox 13 Groupname 13 SendAs
Identity mailbox 14 Groupname 14 SendAs
Identity mailbox 15 Groupname 15 SendAs
Identity mailbox 16 Groupname 16 SendAs