Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Get an array of all security groups a Sharepoint site has

(0) ShareShare
ReportReport
Posted on by 155

Hello!

I'm doing great so far with PA scripts but I have a challenge I can't find the solution to. I want to get a list (preferably an array) of all security groups within a single Sharepoint site. I know I can find the ID of a group if I do a "Send an HTTP request to Sharepoint" if I provide the name of this group and vice versa.

 

But in a scenario where I want to extract all these security groups. What can PA do? Please help 🙂

  • SudeepGhatakNZ Profile Picture
    14,381 Most Valuable Professional on at
    Re: Get an array of all security groups a Sharepoint site has

    You are on the right track @Volt26 ! I would have used the same logic if I were you.

    Your logic is returning SharePoint Groups, while the one I demonstrated via GRAPH API returns Azure AD Groups.

     

  • Volt26 Profile Picture
    155 on at
    Re: Get an array of all security groups a Sharepoint site has

    To be honest, I couldn't figure out how to use what you tried to show me...

     

    I got the list of groups by doing this instead :

    chrome_Yxz4EZ6QrC.png

     

    Can your solution achieve the same goal in a quicker way? A bigger sample would be appreciated because right now, only my way works, yours returns a ton of information but none of it is a Sharepoint security group...

     

  • SudeepGhatakNZ Profile Picture
    14,381 Most Valuable Professional on at
    Re: Get an array of all security groups a Sharepoint site has

    You need to simply provide the displayName of the group after that.

    https://graph.microsoft.com/v1.0/groups returns all groups and I am simply filtering out the one with a specific display name.

     

     

     

  • Volt26 Profile Picture
    155 on at
    Re: Get an array of all security groups a Sharepoint site has

    It looks like a perfect answer but may I ask you how to get the site value variable?
    I trigger the flow manually.. I'll mark it accepted as soon as I can get this one working 🙂

  • Verified answer
    SudeepGhatakNZ Profile Picture
    14,381 Most Valuable Professional on at
    Re: Get an array of all security groups a Sharepoint site has

    Did you mean SharePoint groups or AD Security Groups?

    You can get SharePoint groups using the /_api/web/sitegroups endpoint.

    To query security groups, you need the GRAPH API

     
     

    SudeepGhatakNZ_2-1670200755296.png

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Featured topics

Restore a deleted flow