Skip to content

Instantly share code, notes, and snippets.

@frankhu-2021
Created March 14, 2019 20:07
Show Gist options
  • Save frankhu-2021/cc7d2359c07cd6ca45cfa21fe13133d2 to your computer and use it in GitHub Desktop.
Save frankhu-2021/cc7d2359c07cd6ca45cfa21fe13133d2 to your computer and use it in GitHub Desktop.
This gist is a powershell script utilizing AzureAD Preview to get the claims mapping policies for a service principal.
Connect-AzureAD
Import-Module "AzureADPreview"
$appID = "...guid-of-the-AppID..."
$sp = Get-AzureADServicePrincipal -Filter "servicePrincipalNames/any(n: n eq '$appID')"
$existingPolicies = Get-AzureADServicePrincipalPolicy -Id $sp.ObjectId `
| Where-Object { $_.Type -eq "ClaimsMappingPolicy" }
$existingPolicies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment