The query below takes 30-60 seconds for 10k users, consuming a lot of processor and network bandwith while it runs. Is there a faster way to write this query? I suspect that I am downloading the entire set of tables in #"records" but I am not sure how to select the user table directly.
let Source = ActiveDirectory.Domains("domain.com"), #"records" = Source{[Domain="sub.domain.com"]}[#"Object Categories"], #"select user table" = #"records"{[Category="user"]}[Objects], #"get principal name" = Table.ExpandRecordColumn( #"select user table", "top", {"msDS-PrincipalName"}, {"Principal Name"}), #"filter principal name" = Table.SelectColumns( #"get principal name", {"Principal Name"}) in #"filter principal name"
Thanks in advance..