Skip to content

Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Problems
  • Triggers
  • Application specific solutions
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
Menu

How to remove Office 365 group owner with Power Automate

Posted on April 20, 2022April 20, 2022 by Tom

“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.

Power Automate remove group owner

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.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

NOW AVAILABLE:

The Ultimate Power Automate expressions cheat sheet
Spend your time thinking about what the flow should do, not how to do it!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • How to create a new SharePoint list column with Power Automate flowMay 22, 2022
  • How to combine expressions in your Power Automate flowsMay 18, 2022
  • Import Planner tasks with checklists into various buckets (Power Automate)May 15, 2022
  • How to get notified when Planner task was reassigned (Power Automate)May 11, 2022
  • How to extract value from XML using Power Automate flowMay 8, 2022

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

© 2022 Let's POWER Automate | Powered by Superbs Personal Blog theme