web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / PowerAutomate Loop thr...
Power Automate
Answered

PowerAutomate Loop through an AAD Security Group to find all Users

(0) ShareShare
ReportReport
Posted on by 27

Hi

Is there a way in Power Automate / Power Flow where I can get all the users which belongs to a AAD security group (All_of_IT) and nested groups within the group?

e.g.

  • All_of_IT
    • User_1
    • User_2
    • User_3
    • IT_Operations
      • User_3
      • IT_Developers
        • User_2
        • User_7
        • User_8
      • IT_Engineers
        • User_5
        • User_6
      • IT_Team_Leads
        • User_1
        • User_3
        • User_6

The Flow will receive the Object_Id from a PowerApp App to identify "All_of_ IT" or any other Security Group

The result set should be:

  • User_1
  • User_2
  • User_3
  • User_5
  • User_6
  • User_7
  • User_8

(There is a commandlet in PowerShell called Get-ADGroupMember which will do what I need, but my objective is to find a solution that is a 100% cloud-based.)

 

You help will be much appreciated.

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,507 Most Valuable Professional on at

    Hi @IDonknowwhay,

     

    You could use the List group transitive members method of the Graph API in a Send an HTTP request action of the Groups connector. That method should also list all the members of the nested objects. 

     

    With a filter array you can make sure it only outputs users.


    Below is an example of that approach.

     

    transitivemembers_method.png

  • IDonknowwhay Profile Picture
    27 on at

    Hi @Expiscornovus 

     

    Thank you for the detailed solution 😁

  • Expiscornovus Profile Picture
    33,507 Most Valuable Professional on at

    Hi @IDonknowwhay,


    I had another look, that Filter Array is not even needed. You can even get the users with the setup below.

     

    https://graph.microsoft.com/v1.0/groups/@{variables('Object_Id')}/transitiveMembers/microsoft.graph.user?$count=true

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 60 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 54

#3
Expiscornovus Profile Picture

Expiscornovus 47 Most Valuable Professional

Last 30 days Overall leaderboard