Addition and removal owner of Office 365 Groups, who is not a member, via powershell
Addition and removal owner of Office 365 Groups, who is not a member, via powershell

5 comments
-
Ben K. commented
this is also posting a big concern to use Office Group as an admin. as you may imagine there is reason admin (owner) should not be a group member, but in Stream even Stream admins can't see those groups if they are not owner.
-
Dan M commented
From the issue I logged on Docs:
The PowerShell command forces you to add a user to the members list before it can be added as a owner. The UI in AAD or the M365 admin portal does not enforce this. This restriction should be removed from PowerShell or it should be documented as to why PowerShell is enforcing this.
-
Rob Nicholson commented
This anomaly needs fixing. It's very useful to have a non-member as an owner of the group for the sole reason of accepting access request. You can do it in the GUI but not via PowerShell
-
Martin Tønnesen commented
Yes and you cannot remove a member who is an Owner (but you can in the GUI)
And you cannot add an owner without making him a member (but you can in the GUI)
The documentation also says you can add multiple owners in the new-unifiedgroup but this is not possible for me. -
Ronald commented
Adding an Owner:
This has to be done in 2 steps, first member, than owner:
add-unifiedgrouplinks -LinkType member -Identity [groupname] -links [Accountname]
add-unifiedgrouplinks -LinkType owner -Identity [groupname] -links [Accountname]Removing has to be done also in 2 steps:
remove-unifiedgrouplinks -LinkType owner -Identity [groupname] -links [Accountname]
remove-unifiedgrouplinks -LinkType member -Identity [groupname] -links [Accountname]