'Get effective permissions for user in Azure Resource Group

In a Resource Group Access Control (IAM) you can Check Access for a user, group, service principal or MI on that RG. This check also seems to be able to list access even if the user being searched for is nested inside a group. Is there a powershell equivalent to do the same?

Thanks in advance, Jake.



Solution 1:[1]

ok...it can be done by

Get-AzRoleAssignment -ObjectId <String> -ExpandPrincipalGroups

The -ExpandPrincipalGroups switch only seems to work at the subscription level(but will enumerate at the RG level automatically) and the ObjectId cannot be a service principal

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1