Created
December 10, 2019 10:17
-
-
Save nicolonsky/c0c238724ddf05691e9f28b1b041cf07 to your computer and use it in GitHub Desktop.
Connect to Microsoft Graph with an Azure Service Principal certificate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
servicePrincipalConnection = Get-AutomationConnection -Name "AzureRunAsConnection" -ErrorAction Stop | |
Update-MSGraphEnvironment -AuthUrl "https://login.microsoftonline.com/$($servicePrincipalConnection.TenantId)" -AppId $servicePrincipalConnection.ApplicationId | |
Connect-MSGraph -CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint -Quiet | |
Get-DeviceManagement_ManagedDevices |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment