Forum Discussion
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
- eyalosNew 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)?
- Eric_Zhang
Microsoft Employee
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.