Forum Discussion
jcasqueiro
Feb 21, 2024Copper Contributor
Enabling "send on behalf" capabilities to users in O365 groups
Hi All !
Does anyone have a script to sweep groups in a O365 tenant and give users "send on behalf" permissions?
Thanks/Brgds
joao
- Should be easy to do. Assuming you have the list of groups, you can try something like:
Get-UnifiedGroup -ResultSize 1 -PipelineVariable group | % { Get-UnifiedGroupLinks $_ -LinkType Member -ResultSize 1 | % { Set-UnifiedGroup $group -GrantSendOnBehalfTo @{add=$_.Alias} }}
Treat the above as proof of concept code, as it has zero error handling. Make sure you test it properly before running into production.
4 Replies
Sort By
- Not entirely clear what your ask is. Do you want to grant a specific user send on behalf of permissions to all (or a set of) O365 Groups? Or do you want to grant send on behalf of permissions to all the members of a given group? Or something else altogether?
- jcasqueiroCopper ContributorHi Vasil,
Ideally I would like to grant send on behalf permissions to all users of a specific list of groups (through a csv file or something) but if there is only a script to do this on all O365 groups, it will do.
Thanks/Brgds
joao- Should be easy to do. Assuming you have the list of groups, you can try something like:
Get-UnifiedGroup -ResultSize 1 -PipelineVariable group | % { Get-UnifiedGroupLinks $_ -LinkType Member -ResultSize 1 | % { Set-UnifiedGroup $group -GrantSendOnBehalfTo @{add=$_.Alias} }}
Treat the above as proof of concept code, as it has zero error handling. Make sure you test it properly before running into production.