Forum Discussion

Brahmaiah's avatar
Brahmaiah
Brass Contributor
Aug 27, 2020
Solved

How to List of Azure AD groups for a Service Principal using Power shell

Hi,   I want to fetch list of Azure AD groups which are assigned/ added as member for a service principal.   I am using below script but it is taking too much of time due to for loop each AD grou...
  • Brahmaiah's avatar
    Aug 27, 2020

    Got solution by using below script.

     

    $ServicePrincipalId = Get-AzureADServicePrincipal -All $true | Where {$_.DisplayName -eq 'xxxxx'}
    
    Get-AzureADServicePrincipalMembership -ObjectId $ServicePrincipalId.ObjectId

Resources