Skip to content

Commit 63f5e82

Browse files
committed
Added M query for Active Directory Users and template for quick start development
1 parent b6550ec commit 63f5e82

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

Miscellaneous/Miscellaneous.vbproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
<None Include="App.config" />
131131
<None Include="Scripts\DAX\Dynamic_Number_Format.dax" />
132132
<None Include="Scripts\DAX\Calendar.dax" />
133+
<None Include="Scripts\M\Users.M" />
133134
<None Include="Scripts\RSS\Apply_Header_Footer.rss" />
134135
<None Include="Scripts\RSS\Backup_Reports.rss" />
135136
<None Include="Scripts\DAX\Calendar_Ageing.dax" />
@@ -138,6 +139,7 @@
138139
<None Include="Scripts\M\Calendar.M" />
139140
<None Include="Scripts\RSS\Deploy_Reports.rss" />
140141
<None Include="Config\SSRS_Branding.xlsm" />
142+
<None Include="Templates\Template.pbix" />
141143
</ItemGroup>
142144
<ItemGroup>
143145
<Content Include="Config\Notepad++ DAX.xml" />
@@ -161,9 +163,7 @@
161163
<Install>false</Install>
162164
</BootstrapperPackage>
163165
</ItemGroup>
164-
<ItemGroup>
165-
<Folder Include="Templates\" />
166-
</ItemGroup>
166+
<ItemGroup />
167167
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
168168
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
169169
Other similar extension points exist, see Microsoft.Common.targets.

Miscellaneous/Scripts/M/Users.M

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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"
820 KB
Binary file not shown.

0 commit comments

Comments
 (0)