Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save frankhu-2021/877b14f2ef048ba64282a6ab530ee9c5 to your computer and use it in GitHub Desktop.
Save frankhu-2021/877b14f2ef048ba64282a6ab530ee9c5 to your computer and use it in GitHub Desktop.
connect-azuread
$SPObjectID = "your-spn-objectid"
$role = (Get-AzureADDirectoryRole).objectId
For ($i=0; $i -lt $role.Count; $i++){
if(Get-AzureADDirectoryRoleMember -ObjectId $role.Get($i) | where {$_.objectId -eq $SPObjectID}) {
$role.DisplayName
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment