SOLVED

Enabling "send on behalf" capabilities to users in O365 groups

Brass Contributor

Hi All !

Does anyone have a script to sweep groups in a O365 tenant and give users "send on behalf" permissions? 

Thanks/Brgds

joao

4 Replies
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?
Hi 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
best response confirmed by Joao Casqueiro (Brass Contributor)
Solution
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.
1 best response

Accepted Solutions
best response confirmed by Joao Casqueiro (Brass Contributor)
Solution
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.

View solution in original post