“Is there a way to remove another owner from an Office 365 group with Power Automate, or do I have to do it via administration?”
There’re some things you can do directly with an action, and some things you can’t. You can add a member to an Office 365 group, you can also remove a member, but there’re no owner actions. There’s no action called ‘Remove owner from group’ that would let you do that.
What is the workaround then? How do you remove an owner from a group, and not only a member?
Send an HTTP request to Graph API
As many times before, if there’s no action, you can probably do it with an HTTP request. But this time it’s not an HTTP request to SharePoint, it’s another request to the Graph API. If you check the documentation, you’ll see that such request needs two inputs. It needs the Group ID and the User ID.
https://graph.microsoft.com/v1.0/groups/<groupID>/owners/<userID>/$ref
Get the Group ID
Let’s get the Group ID first. To remove an owner from a group, you must be also one of the owners. Start with the action ‘List my owned groups’ to get all the such groups.
Now, when you’ve got all the groups, it’s time to find the right one and its ID. Add ‘Filter array’ to find only the specific group, e.g. by the name.
One group should remain, the one whose ID you need.
Get the User ID
The second input for the HTTP request is the user ID. If you have only the user email address, you can use the ‘Get user profile (V2)’ action to get the user information, including the user ID.
All that’s left is to put it in the HTTP request.
Use them in the HTTP request
Since you’re accessing the Office 365 groups, you can use the Office 365 Groups action ‘Send an HTTP request’. Take the HTTP request from the beginning and replace the placeholders.
https://graph.microsoft.com/v1.0/groups/<Group ID from Filter array>/owners/<User ID from Get user profile>/$ref
Don’t worry about the automatically added ‘Apply to each’, you should always filter only a single group. But if it bothers you, you can remove it.
And as you’re removing an owner, the Method should be DELETE.
Summary
It is possible to remove Office 365 group owner with a Power Automate flow, but you’ll need an HTTP request. Get the Group ID and User ID, combine them in the request Uri, and remove them.
You can also list the owners first if you’re not sure who’s in there.
Yo, Tom, Eliot from the community here. I’ve atted you in Anna’s new thread, but whilst this particular action will be safe, they’re kneecapping this action in the new version.