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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Get Members of Nested ...
Power Apps
Suggested Answer

Get Members of Nested AD groups in PowerApps

(2) ShareShare
ReportReport
Posted on by 28
Hello-
I have a requirement where I am trying to get all the users from an AD group. I am using the Office365Group Connection as such 
ClearCollect( 
    officeAUSers, 
    Office365Groups.ListGroupMembers ("groupID").value );
This provides me with the output, but the output shows other AD groups nested within it as such 
AD group : OfficeA-All
and the output is User A, User B, OfficeA-TeamLead, OfficeA- Managers, where OfficeA-TeamLead, OfficeA- Managers, are AD groups by itself nested with OfficeA-All.
 
How can i get all the users using PowerApps, is it even possible, if not can you please guide me on how I can achieve this ?
 
Thank you 
Categories:
I have the same question (0)
  • Suggested answer
    Nandit Profile Picture
    1,568 Moderator on at
    Hi New1,
     
    This code will only return what's in the main group - the users and other nested groups. This is a limitation.
    As a workaround, you can create separate collections for these groups and then merge them with the main collection. 
    ClearCollect( 
        officeAUSers, 
        Office365Groups.ListGroupMembers ("groupID").value );
    
    ClearCollect( 
        OfficeA-TeamLead, 
        Office365Groups.ListGroupMembers ("groupID_OfficeA-TeamLead").value );
    
    ClearCollect( 
        OfficeA- Managers, 
        Office365Groups.ListGroupMembers ("groupID_OfficeA- Managers").value );
    
    ClearCollect(AllUsers, officeAUSers, OfficeA-TeamLead, OfficeA- Managers)
    Hope this helps. 
     
    Kind regards, 
    Nandit 
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     
     
  • Nandit Profile Picture
    1,568 Moderator on at
    Hi New1,
     
    Can you also try using the Microsoft Entra ID connector and the following formula:
    MicrosoftEntraID.GetGroupMembers(GroupID)
    I think this might get you the users from nested groups as well. Let me know how it goes. 
     
    Hope it helps.
     
    Kind regards, 
    Nandit 
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard