Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

List members of a SharePoint group with Power Automate

Posted on November 27, 2022November 27, 2022 by Tom

“Can I use Power Automate for daily checks of SharePoint group members, to see if users added somebody who shouldn’t be there?”


Even though SharePoint groups should be a thing of the past, many users still use them. Instead of using an AD group with managed access they add users directly to SP groups. Which can be a problem – there might be users who have access to data without you even knowing.

That’s not an ideal situation, yet there’s always a flow to help you!

Get the group members

Since there’s no dedicated action, you’ll need another HTTP request to SharePoint. Similarly as when adding users to a SP group, you must find the group first. But don’t stop after the group name, you want to take it one step further – to the users in that group.

Method: GET

Uri:
_api/web/siteGroups/getByName('<groupName>')/Users
Power Automate SharePoint group members

Such request will return list of all members of the group – AD groups and members alike. Since AD groups are fine and you’re interested only in the users, filter them out.

Navigate in the JSON to get an array with the users to use it in the ‘Filter array’ action.

body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']

While checking the JSON, you might also notice that there’s a difference between AD groups and users – users have a value in the ‘UserId’ parameter. Use it in the filter to remove all groups (where the ‘UserId’ is null).

item()?['UserId'] <is not equal to> null
Power Automate SharePoint group members

The result will be only users who were added directly into the SharePoint group. Now it’s up to you how to handle them.

Summary

To keep control over sensitive data you should know who can access them. If they’re stored in SharePoint it means knowing who’re the members of related SharePoint group, and Power Automate can help you with that. Get the users in the SharePoint group, filter out the AD groups as they’re often managed, and keep only the members added directly. In an ideal situation it should never find such users.


πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

6 thoughts on “List members of a SharePoint group with Power Automate”

  1. Uchenna says:
    February 16, 2023 at 4:55 pm

    Excellent explanation. Exactly what I was looking for. Thanks

    Reply
  2. Maria says:
    September 13, 2023 at 6:04 pm

    Can you update this to be able to grab users from multiple groups?

    _api/web/siteGroups/getByName(‘[Entity]’)/users

    The SharePoint item can have up to two Permission groups on a submission, and we need to notify all the users from both groups. Thank you for your assistance!

    Reply
    1. Tom says:
      September 30, 2023 at 10:27 pm

      Hello Maria,
      it can always grab only 1 group, if you have more than 1 group use the request multiple times to get the users from all the groups one by one.

      Reply
  3. K.Rakesh Gochhi says:
    October 19, 2023 at 9:44 pm

    Is it possible to remove owners too with their access for a particular item?

    Reply
    1. Tom says:
      November 19, 2023 at 1:46 pm

      Hello Rakesh,
      no, site owners own everything on the SharePoint site, no way to remove them.

      Reply
  4. Vasu says:
    August 29, 2024 at 12:10 pm

    Is it possible to pull all full control access permission members from site.
    If we provide few user to full control out side of the group. how can pull them ?

    Reply

Leave a Reply Cancel reply

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

πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Working on an Approval process?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy a fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes