Last active
November 18, 2021 23:14
-
-
Save darrenjrobinson/0e17353277a5796e20aa72e18f3171e7 to your computer and use it in GitHub Desktop.
Get Microsoft Graph Permission Scope IDs using a PowerShell Azure Cloud Shell CLI. Associated blogpost https://blog.darrenjrobinson.com/microsoft-graph-permission-scope-ids/
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
# Get Service Principals | |
$spList = az ad sp list --all | |
$spListObj = $spList | ConvertFrom-Json | |
# Get Graph Permissions | |
$graphSP = $spListObj | Where-Object {$_.appID -eq '00000003-0000-0000-c000-000000000000'} | Select-Object | |
# List of Application Scopes | |
$adminScopes = $graphSP.oauth2Permissions | Where-Object {$_.type -eq 'Admin'} | Sort-Object value | Select-Object id, isEnabled, type, adminConsentDescription, adminConsentDisplayName, value | |
# List of Delegated Scopes | |
$userScopes = $graphSP.oauth2Permissions | Where-Object {$_.type -eq 'User'} | Sort-Object value | Select-Object id, isEnabled, type, userConsentDescription, userConsentDisplayName, value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment