Skip to content

Instantly share code, notes, and snippets.

@tabs-not-spaces
Last active May 28, 2020 10:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tabs-not-spaces/1a733e649beb72ff62a68a5270620db2 to your computer and use it in GitHub Desktop.
Save tabs-not-spaces/1a733e649beb72ff62a68a5270620db2 to your computer and use it in GitHub Desktop.
Intune authentication example
if (!(Get-Module -Name MSAL.PS -ListAvailable -ErrorAction SilentlyContinue)) {
Install-Module -Name MSAL.PS -Scope CurrentUser -Force
}
$clientId = "d1ddf0e4-d672-4dae-b554-9d5bdfd93547" # well known Intune application Id
$auth = Get-MsalToken -ClientId $clientId -deviceCode #deviceCode requires interaction and solves MFA challenges
$token = @{ Authorization = $auth.CreateAuthorizationHeader() }
@bezik46
Copy link

bezik46 commented Apr 25, 2020

Not 2FA ready

@tabs-not-spaces
Copy link
Author

tabs-not-spaces commented Apr 25, 2020 via email

@bezik46
Copy link

bezik46 commented May 10, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment