1+ // Active Directory list of users , set the parameter "domain_name"
2+
3+ let
4+ Source = ActiveDirectory .Domains (domain_ name ),
5+ domain_ name = Source {[Domain = domain_ name ]}[# "Object Categories" ],
6+ user1 = domain_ name {[Category = "user" ]}[Objects ],
7+ # "Removed Other Columns" = Table .SelectColumns (user1 ,{"organizationalPerson" , "displayName" }),
8+ # "Reordered Columns" = Table .ReorderColumns (# "Removed Other Columns" ,{"displayName" , "organizationalPerson" }),
9+ # "Expanded organizationalPerson1" = Table .ExpandRecordColumn (# "Reordered Columns" , "organizationalPerson" , {"mail" , "thumbnailPhoto" , "title" , "department" }, { "User Email" , "thumbnailPhoto" , "title" , "department" }),
10+ # "Changed Type" = Table .TransformColumnTypes (# "Expanded organizationalPerson1" ,{{"thumbnailPhoto" , type text }}),
11+ # "Added Prefix" = Table .TransformColumns (# "Changed Type" , {{"thumbnailPhoto" , each "data:image/jpeg;base64," & _ , type text }}),
12+ # "Filtered Rows" = Table .SelectRows (# "Added Prefix" , each ([thumbnailPhoto ] <> null )),
13+ # "Removed Duplicates" = Table .Distinct (# "Filtered Rows" , {"User Email" }),
14+ # "Filtered Rows1" = Table .SelectRows (# "Removed Duplicates" , each ([User Email ] <> null and [User Email ] <> "-" )),
15+ # "Renamed Columns" = Table .RenameColumns (# "Filtered Rows1" ,{{"displayName" , "User_Full_Name" }, {"User Email" , "User_Email" }, {"thumbnailPhoto" , "User_Photo" }, {"department" , "Department" }, {"title" , "Title" }})
16+ in
17+ # "Renamed Columns"
0 commit comments