Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save frankhu-2021/b5819944f848272765dd3e3a560c9180 to your computer and use it in GitHub Desktop.
Save frankhu-2021/b5819944f848272765dd3e3a560c9180 to your computer and use it in GitHub Desktop.
connect-azuread
$appname = "Your-App-Registration-Name"
$sp = Get-AzureADServicePrincipal -filter "DisplayName eq '$appname'"
$role = Get-AzureADDirectoryRole
For ($i=0; $i -lt $role.Count; $i++){
if(Get-AzureADDirectoryRoleMember -ObjectId $role.Get($i) | | where {$_.DisplayName -eq $appname}) {
$role.DisplayName
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment