azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Get-AzureRmRoleAssignment -SignInName -ExpandPrincipalGroups broken

Open marekciel opened this issue 9 years ago • 5 comments

Cmdlet(s)

Get-AzureRmRoleAssignment

PowerShell Version

Name Value


PSVersion 5.1.15063.674
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.15063.674
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Module Version

ModuleType Version Name


Script 4.0.0 AzureRM.profile
Script 5.0.0 AzureRM.Resources

Description

Get-AzureRmRoleAssignment -SignInName -ExpandPrincipalGroups was working correctly using Azurerm.Resources -version 4.1.0 and Azurerm.profile 3.1.0

The command was returning user role assignment based on direct user assignment and if the user was in the group or not. Since I have update the module this functionality is now returning a lot of different permission and not consistent.

Get-AzureRmRoleAssignment -SignInName [email protected] -ExpandPrincipalGroups

marekciel avatar Nov 15 '17 13:11 marekciel

@cielakm Hey Marek, what are some of the inconsistencies you are seeing? Would you mind providing a few example outputs you are seeing for AzureRM 4.1.0 vs 5.0.0?

CC: @darshanhs90

cormacpayne avatar Nov 16 '17 16:11 cormacpayne

Hi @cormacpayne thank you for looking in to this. Please find my note below.

If I run this command: Get-AzureRmRoleAssignment -SignInName [email protected] -ExpandPrincipalGroups | select DisplayName,SignInName,RoleDefinitionName,ObjectType,scope | ft

on 4.1.0 image this is the output: image

Which only displayed the groups that the user is a part of and have been assign to Sub, RG or resource.

If I run the same command on 5.0.0 image this is the output: image

It looks like it display information about all access permissions for anyone and any group in the scope of subscription,RG and resource.

This is not what is explained in this article https://docs.microsoft.com/en-us/azure/active-directory/role-based-access-control-manage-access-powershell

marekciel avatar Nov 17 '17 15:11 marekciel

Hi @cormacpayne do you need any more info on this?

marekciel avatar Nov 27 '17 11:11 marekciel

Fixed in the PR linked above, and will be included in the next release.

maddieclayton avatar Feb 22 '18 22:02 maddieclayton

I want to make a csv with the infos of Get-AzureRoleAssignment. But I cant catch the atributes of each role of each resource group

silva-3 avatar Oct 22 '18 19:10 silva-3