Microsoft 365 distribution group – Send as permission – How to enable?

I created a distribution group in Microsoft 365 and would like to add an user to send email on behalf of this group. When I try to send and select this group in the ‘From’ button in my outlook, I get following error:  
*This message could not be sent. You do not have the permission to send the message on behalf of the specified user.

So how to do it?

Launch cloud exchange >> connect to exchange server the run the desired commands below.

To add a user with “Send As” permissions for a distribution group

Add-RecipientPermission -identity hpskoreamarketing@hpspartners.com -trustee katie.bovard@hpspartners.com -AccessRights sendas

To add a user with “Send On Behalf of” permissions for a distribution group

Set-DistributionGroup -Identity investorrelations@hpspartners.com -GrantSendOnBehalfTo @{Add=”ralph.shields@hpspartners.com“}

To add multiple users with “Send On Behalf of” permissions for a distribution group

 Set-DistributionGroup “investorrelations@hpspartners.com” -GrantSendOnBehalfTo @{Add=”smtp1″,”smtp2″,”smtp3″}

Hope this helps