Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Evogelpohl
Helper V
Helper V

Active Directory - Get Members of Dynamic Group

Using the Active Directory (AD) connector in Power Query (latest ver), I'm able to view all groups, but i'm not able to 'Expand' to Group.Member on AD groups that are Dynamic, or those groups that use LDAP queries to populate them.

 

Is this a feature/limitation of AD or a bug perhaps?

 

Here's the code that should return all users in a group.   

 

let
    Source = ActiveDirectory.Domains("DOMAIN.com"),
    DOMAIN.com = Source{[Domain="DOMAIN.com"]}[#"Object Categories"],
    group1 = DOMAIN.com{[Category="group"]}[Objects],
    #"Expanded securityPrincipal" = Table.ExpandRecordColumn(group1, "securityPrincipal", {"sAMAccountName"}, {"securityPrincipal.sAMAccountName"}),
    #"Filtered Rows" = Table.SelectRows(#"Expanded securityPrincipal", each [securityPrincipal.sAMAccountName] = "ALL-EmplsAndContractors"),
    #"Expanded group" = Table.ExpandRecordColumn(#"Filtered Rows", "group", {"member"}, {"group.member"}),
    #"Expanded group.member" = Table.ExpandListColumn(#"Expanded group", "group.member")
in
    #"Expanded group.member"
3 REPLIES 3
I_Like_Pi
Resolver II
Resolver II

I found a post here with some code that I am trying to adapt

 

https://matt40k.uk/2016/06/getting-a-list-of-ad-groups-and-their-members-using-powerquery/

 

It's a blog post.

If I get anywhere I will update this post.

mpark14845
New Member

Anyone get an answer on this?  I would really like to get the number of users per group.  I can see the count when I click on the List field for the record but would love to bring this value forward to report on it.

lukasdrbo
New Member

Hi,

 

did you resolve this issue or not ?

 

thank you,

 

best regards,

 

Lukas

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.