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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dskeane
Helper I
Helper I

AD Groups

Looking to modify the code below. The code itself works great however I dont need the filter (thanks to user amitchandak). 

 

My end result needs to be showing all security user groups, hope this makes sense and that it can be done in the code vs creating a relationship with the user table. 

 

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] = "SecurityGroupName"),
#"Expanded group" = Table.ExpandRecordColumn(#"Filtered Rows", "group", {"member"}, {"group.member"}),
#"Expanded group.member" = Table.ExpandListColumn(#"Expanded group", "group.member"),
#"Expanded group.member.name" = Table.ExpandRecordColumn(#"Expanded group.member", "group.member", {"name"}, {"name"})
in
#"Expanded group.member.name"

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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"}),
#"Expanded group" = Table.ExpandRecordColumn(#"Expanded securityPrincipal", "group", {"member"}, {"group.member"}),
#"Expanded group.member" = Table.ExpandListColumn(#"Expanded group", "group.member"),
#"Expanded group.member.name" = Table.ExpandRecordColumn(#"Expanded group.member", "group.member", {"name"}, {"name"})
in
#"Expanded group.member.name"

 

it is not very clear what you are looking for, but let's give it a tr.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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"}),
#"Expanded group" = Table.ExpandRecordColumn(#"Expanded securityPrincipal", "group", {"member"}, {"group.member"}),
#"Expanded group.member" = Table.ExpandListColumn(#"Expanded group", "group.member"),
#"Expanded group.member.name" = Table.ExpandRecordColumn(#"Expanded group.member", "group.member", {"name"}, {"name"})
in
#"Expanded group.member.name"

 

it is not very clear what you are looking for, but let's give it a tr.

This is exactly what I was looking for. Thanks and sorry for the lack of detail, credit to you for reading between the lines also : ) 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors