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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
eyalos
New Member

Query all sub domains in active directory

Hi

I am trying to get all the users that are working under 2 specific managers

I connected the PBI to Active directory using the Active Directory connector

the problem is that we have a lot of sub domains (over 30) and i haven't found how to query all the sub domains in one query (recursively) instead of querying each sub domain separately

these are the steps i did:

 

step1: Source

= ActiveDirectory.Domains("Domain.corp")

Step2: Navigation

= Country1.Domain.Corp{[Category="user"]}[Objects]

Step3: Expanded user

= Table.ExpandRecordColumn(user1, "user", {"manager"}, {"user.manager"})

Step4: Expanded user.manager

= Table.ExpandRecordColumn(#"Expanded user", "user.manager", {"displayName"}, {"Manager"})

Step5: Filter

= Table.SelectRows(#"Expanded user.manager", each [Manager] = "Manager1 name" or [Manager] = "Manager2 name")

 

In order to reach my goal in all the sub domains (countries) i need to do this for each country separately and that sounds unreasonable

is there any way to do this recursively to all sub domains (countries)

2 REPLIES 2
eyalos
New Member

Hi I am trying to get all the users that are working under 2 specific managers.

I connected the PBI to Active directory using the Active Directory connector.

The problem is that we have a lot of sub domains (over 30) and i haven't found how to query all the sub domains in one query (recursively) instead of querying each sub domain separately.

These are the steps i did:

step1: Source

   = ActiveDirectory.Domains("Domain.corp")

Step2: Navigation

   = Country1.Domain.Corp{[Category="user"]}[Objects]

Step3: Expanded user

   = Table.ExpandRecordColumn(user1, "user", {"manager"}, {"user.manager"})

Step4: Expanded user.manager

   = Table.ExpandRecordColumn(#"Expanded user", "user.manager", {"displayName"}, {"Manager"})

Step5: Filter

   = Table.SelectRows(#"Expanded user.manager", each [Manager] = "Manager1 name" or [Manager] = "Manager2 name")

 

In order to reach my goal in all the sub domains (countries) i need to do this for each country separately and that sounds unreasonable.

Is there any way to do this recursively to all sub domains (countries)?

@eyalos

I‘m not familiar with the AD, is it possible to get a sub domain list? If you have the list, then you can create a function expanding the domain info and call for each row in the domain list.

 

Capture1.PNG

 

Capture2.PNG

 

Capture.PNG

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors