Forum Discussion
jcasqueiro
Feb 21, 2024Brass 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
- Feb 22, 2024Should 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.
VasilMichev
Feb 21, 2024MVP
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?
jcasqueiro
Feb 22, 2024Brass Contributor
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
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
- VasilMichevFeb 22, 2024MVPShould 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.- jcasqueiroFeb 23, 2024Brass ContributorThanks Vasil