Contents

Plugin Test


A list of random plugins to test my Hugo deployment.

Sequence Diagram

Gantt Chart

GoAT Diagrams

123412341234123412341234

C#

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// See https://aka.ms/new-console-template for more information
// https://graph.microsoft.com/v1.0/users?$filter=endsWith(userPrincipalName, 'contoso.com%23EXT%23%40microsoft.onmicrosoft.com')&$select=userPrincipalName&$count=true

using Azure.Identity;
using Microsoft.Graph;
using Microsoft.Graph.Models;

var domainList = new Dictionary<string, List<string>>()
{
    {
        "Contoso", new List<string>()
        {
            "contoso.com#EXT#@microsoft.onmicrosoft.com",
        }
    },
    {
        "Fabrikam", new List<string>()
        {
            "fabrikam.com#EXT#@microsoft.onmicrosoft.com",
        }
    }
};

var defaultAzureCredential = new DefaultAzureCredential();
var graphServiceClient = new GraphServiceClient(defaultAzureCredential);

var count = 0;
using var streamWriter = new StreamWriter("output.csv");

foreach (var kvp in domainList)
{
    foreach (var domain in kvp.Value)
    {
        var userCollectionResponse = await graphServiceClient.Users
            .GetAsync((requestConfiguration) =>
            {
                requestConfiguration.Headers.Add("ConsistencyLevel", "eventual");
                requestConfiguration.QueryParameters.Filter = $"endsWith(userPrincipalName, '{domain}')";
                requestConfiguration.QueryParameters.Select = new[] { "id, displayName, userPrincipalName" };
                requestConfiguration.QueryParameters.Count = true;
            });

        if (userCollectionResponse != null)
        {
            var pageIterator = PageIterator<User, UserCollectionResponse>
                .CreatePageIterator(graphServiceClient, userCollectionResponse, async (user) =>
                {
                    await streamWriter.WriteLineAsync($"{count++}, {kvp.Key}, {user.Id}, {user.DisplayName}, {user.UserPrincipalName}");
                    return true;
                });

            await pageIterator.IterateAsync();
        }
    }
}

graphServiceClient.Dispose();

Map

Gist

Tweet

YouTube

ECharts