Skip to content

Commit

Permalink
Additions for Part 9 Connectors/Tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniehack committed Aug 1, 2024
1 parent 6de18a0 commit 93057ec
Show file tree
Hide file tree
Showing 10 changed files with 202 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
let

// Application Registration Permissions needed to make this call : DeviceManagementServiceConfig.ReadWrite.All
// DeviceManagementManagedDevices.Read.All

// Microsoft Graph URL
Endpoint = "https://graph.microsoft.com/",
Version = "beta/",
Resource = "deviceManagement/applePushNotificationCertificate/",
QueryParams = "",
GraphURL = Endpoint & Version & Resource & QueryParams,

// Get an Access Token to make Graph Calls (uses Application Registration)
Bearer = #"Get-BearerToken" (TenantID, AppID, SecretID, Endpoint),

// Direct Graph call (No pagination)
DirectGraphCall = Json.Document(Web.Contents(
GraphURL,
[
Headers=[#"Content-Type"="application/json", #"Authorization"=Bearer]
]
)),
#"Converted to Table" = Record.ToTable(DirectGraphCall),

// Formatting
#"Transposed Table" = Table.Transpose(#"Converted to Table"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"@odata.context", type text}, {"id", type text}, {"appleIdentifier", type text}, {"topicIdentifier", type text}, {"lastModifiedDateTime", type datetime}, {"expirationDateTime", type datetime}, {"certificateUploadStatus", type any}, {"certificateUploadFailureReason", type any}, {"certificateSerialNumber", type text}, {"certificate", type any}})
in
#"Changed Type"
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
let

// Application Registration Permissions needed to make this call : DeviceManagementConfiguration.Read.All

// Microsoft Graph URL
Endpoint = "https://graph.microsoft.com/",
Version = "beta/",
Resource = "deviceManagement/domainJoinConnectors/",
QueryParams = "",
GraphURL = Endpoint & Version & Resource & QueryParams,

// Get an Access Token to make Graph Calls (uses Application Registration)
Bearer = #"Get-BearerToken" (TenantID, AppID, SecretID, Endpoint),

// Direct Graph call (No pagination)
DirectGraphCall = Json.Document(Web.Contents(
GraphURL,
[
Headers=[#"Content-Type"="application/json", #"Authorization"=Bearer]
]
)),
value = DirectGraphCall[value],
#"Converted to Table" = Table.FromList(value, Splitter.SplitByNothing(), null, null, ExtraValues.Error),

// Formatting
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "displayName", "lastConnectionDateTime", "state", "version"}, {"id", "displayName", "lastConnectionDateTime", "state", "version"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Column1",{{"lastConnectionDateTime", type datetime}})
in
#"Changed Type"
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
let

// Application Registration Permissions needed to make this call : DeviceManagementConfiguration.Read.All

// Microsoft Graph URL
Endpoint = "https://graph.microsoft.com/",
Version = "beta/",
Resource = "deviceManagement/androidManagedStoreAccountEnterpriseSettings",
QueryParams = "",
GraphURL = Endpoint & Version & Resource & QueryParams,

// Get an Access Token to make Graph Calls (uses Application Registration)
Bearer = #"Get-BearerToken" (TenantID, AppID, SecretID, Endpoint),

// Direct Graph call (No pagination)
DirectGraphCall = Json.Document(Web.Contents(
GraphURL,
[
Headers=[#"Content-Type"="application/json", #"Authorization"=Bearer]
]
)),
#"Converted to Table" = Record.ToTable(DirectGraphCall),

// Formatting
#"Transposed Table" = Table.Transpose(#"Converted to Table"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"@odata.context", type text}, {"id", type text}, {"bindStatus", type text}, {"lastAppSyncDateTime", type datetime}, {"lastAppSyncStatus", type text}, {"ownerUserPrincipalName", type text}, {"ownerOrganizationName", type text}, {"lastModifiedDateTime", type datetime}, {"enrollmentTarget", type text}, {"targetGroupIds", type any}, {"deviceOwnerManagementEnabled", type logical}, {"androidDeviceOwnerFullyManagedEnrollmentEnabled", type logical}, {"managedGooglePlayInitialScopeTagIds", type any}, {"companyCodes", type any}})
in
#"Changed Type"
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
let

// Application Registration Permissions needed to make this call : DeviceManagementConfiguration.Read.All

// Microsoft Graph URL
Endpoint = "https://graph.microsoft.com/",
Version = "beta/",
Resource = "deviceManagement/ndesConnectors/",
QueryParams = "",
GraphURL = Endpoint & Version & Resource & QueryParams,

// Get an Access Token to make Graph Calls (uses Application Registration)
Bearer = #"Get-BearerToken" (TenantID, AppID, SecretID, Endpoint),

// Direct Graph call (No pagination)
DirectGraphCall = Json.Document(Web.Contents(
GraphURL,
[
Headers=[#"Content-Type"="application/json", #"Authorization"=Bearer]
]
)),
value = DirectGraphCall[value],

// Formatting
#"Converted to Table" = Table.FromList(value, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Display Name" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "lastConnectionDateTime", "state", "displayName", "machineName", "enrolledDateTime", "roleScopeTagIds", "connectorVersion"}, {"id", "lastConnectionDateTime", "state", "displayName", "machineName", "enrolledDateTime", "roleScopeTagIds", "connectorVersion"}),
#"Renamed Connector Version" = Table.RenameColumns(#"Expanded Display Name",{{"displayName", "Display Name"}, {"connectorVersion", "Connector Version"}})

in
#"Renamed Connector Version"
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
let

// Application Registration Permissions needed to make this call : DeviceManagementServiceConfig.Read.All

// Microsoft Graph URL
Endpoint = "https://graph.microsoft.com/",
Version = "beta/",
Resource = "deviceManagement/depOnboardingSettings/",
QueryParams = "",
GraphURL = Endpoint & Version & Resource & QueryParams,

// Get an Access Token to make Graph Calls (uses Application Registration)
Bearer = #"Get-BearerToken" (TenantID, AppID, SecretID, Endpoint),

// Direct Graph call (No pagination)
DirectGraphCall = Json.Document(Web.Contents(
GraphURL,
[
Headers=[#"Content-Type"="application/json", #"Authorization"=Bearer]
]
)),
value = DirectGraphCall[value]{0},

// Formatting
#"Converted to Table" = Record.ToTable(value),
#"Transposed Table" = Table.Transpose(#"Converted to Table"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"id", type text}, {"appleIdentifier", type text}, {"tokenExpirationDateTime", type datetime}, {"lastModifiedDateTime", type datetime}, {"lastSuccessfulSyncDateTime", type datetime}, {"lastSyncTriggeredDateTime", type datetime}, {"shareTokenWithSchoolDataSyncService", type logical}, {"lastSyncErrorCode", Int64.Type}, {"tokenType", type text}, {"tokenName", type text}, {"syncedDeviceCount", Int64.Type}, {"dataSharingConsentGranted", type logical}, {"roleScopeTagIds", type any}})
in
#"Changed Type"
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
let

// Microsoft Graph URL
Endpoint = "https://graph.microsoft.com/",
Version = "beta/",
Resource = "deviceManagement/dataProcessorServiceForWindowsFeaturesOnboarding",
QueryParams = "",
GraphURL = Endpoint & Version & Resource & QueryParams,

// Get an Access Token to make Graph Calls (uses Application Registration)
Bearer = #"Get-BearerToken" (TenantID, AppID, SecretID, Endpoint),

// Direct Graph call (No pagination)
DirectGraphCall = Json.Document(Web.Contents(
GraphURL,
[
Headers=[#"Content-Type"="application/json", #"Authorization"=Bearer]
]
)),
#"Converted to Table" = Record.ToTable(DirectGraphCall),

// Formatting
#"Transposed Table" = Table.Transpose(#"Converted to Table"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"@odata.context", type text}, {"hasValidWindowsLicense", type logical}, {"areDataProcessorServiceForWindowsFeaturesEnabled", type logical}})
in
#"Changed Type"
27 changes: 27 additions & 0 deletions PowerQuery/Templates/Direct-Bearer.pq
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
let

// Application Registration Permissions needed to make this call :

// Microsoft Graph URL
Endpoint = "https://graph.microsoft.com/",
Version = "",
Resource = "",
QueryParams = "",
GraphURL = Endpoint & Version & Resource & QueryParams,

// Get an Access Token to make Graph Calls (uses Application Registration)
Bearer = #"Get-BearerToken" (TenantID, AppID, SecretID, Endpoint),

// Direct Graph call (No pagination)
DirectGraphCall = Json.Document(Web.Contents(
GraphURL,
[
Headers=[#"Content-Type"="application/json", #"Authorization"=Bearer]
]
)),
value = DirectGraphCall[value]

// Formatting

in
value
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 93057ec

Please sign in to comment.