Search code examples
azurepowershellazure-active-directoryazure-role-environment

Fetch Azure role assignments to AAD groups


In our current azure tenant we have 100's of subscriptions, user access is managed by azure AAD groups.

How can i view roles assigned to a group, Assume 1 group had access to only 1 subscription out of 100 subscriptions then from portal i need to select each and every subscription in group Azure role assignment page.

I wonder is there any direct way to fetch using powershell?

Thanks dev


Solution

  • Usually we use the Get-AzRoleAssignment command to list all the role assignments that are valid on the scope. If no parameters are specified, this command will return all the role assignments made under the subscription.

    For your problem, you want to use a security group to filter this list, just use the Azure AD group ObjectId parameter:

    Get-AzRoleAssignment -ObjectId  <your group objectid>
    

    enter image description here