Using Azure AD Device Code Flow with PowerShell

Azure AD supports OAuth 2.0 Device Flow for Browserless and Input Constraint devices, as described here; https://tools.ietf.org/html/draft-ietf-oauth-device-flow-07 Assuming you do not want to, or cannot, use ADAL in PowerShell, you can script this flow entirely in native PowerShell. $clientId = "1950a258-227b-4e31-a9cf-717495945fc2" # This is the standard Client Identifier for Windows Azure PowerShell $redirectUrl = [System.Uri]"urn:ietf:wg:oauth:2.0:oob"…