The below script with change the owner of a group, giving the new owner admin rights to the group.

Connecting to Office 365

Changing the group owner using Set-DistributionGroup

Change the GroupAlias and NewOwnersEmailAddress to the relevant values.