Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Get-AzureRoleAssignment

Get-AzureRoleAssignment

microsoft.azure.commands.resources.dll

Synopsis

Filters role assignments.

Syntax

Get-AzureRoleAssignment [-RoleDefinitionName] [<CommonParameters>]

Get-AzureRoleAssignment [-ObjectId] [-RoleDefinitionName] [<CommonParameters>]

Get-AzureRoleAssignment [-ObjectId] [-ResourceGroupName] [-ResourceName] [-ResourceType] [-ParentResource] [-RoleDefinitionName] [<CommonParameters>]

Get-AzureRoleAssignment [-ObjectId] [-ResourceGroupName] [-RoleDefinitionName] [<CommonParameters>]

Get-AzureRoleAssignment [-ObjectId] [-RoleDefinitionName] [-Scope] [<CommonParameters>]

Get-AzureRoleAssignment [-Mail] [-ResourceGroupName] [-ResourceName] [-ResourceType] [-ParentResource] [-RoleDefinitionName] [<CommonParameters>]

Get-AzureRoleAssignment [-Mail] [-ResourceGroupName] [-RoleDefinitionName] [<CommonParameters>]

Get-AzureRoleAssignment [-Mail] [-RoleDefinitionName] [-Scope] [<CommonParameters>]

Get-AzureRoleAssignment [-Mail] [-RoleDefinitionName] [<CommonParameters>]

Get-AzureRoleAssignment [-UserPrincipalName] [-RoleDefinitionName] [<CommonParameters>]

Get-AzureRoleAssignment [-UserPrincipalName] [-ResourceGroupName] [-RoleDefinitionName] [<CommonParameters>]

Get-AzureRoleAssignment [-UserPrincipalName] [-ResourceGroupName] [-ResourceName] [-ResourceType] [-ParentResource] [-RoleDefinitionName] [<CommonParameters>]

Get-AzureRoleAssignment [-UserPrincipalName] [-RoleDefinitionName] [-Scope] [<CommonParameters>]

Get-AzureRoleAssignment [-ServicePrincipalName] [-ResourceGroupName] [-ResourceName] [-ResourceType] [-ParentResource] [-RoleDefinitionName] [<CommonParameters>]

Get-AzureRoleAssignment [-ServicePrincipalName] [-ResourceGroupName] [-RoleDefinitionName] [<CommonParameters>]

Get-AzureRoleAssignment [-ServicePrincipalName] [-RoleDefinitionName] [<CommonParameters>]

Get-AzureRoleAssignment [-ServicePrincipalName] [-RoleDefinitionName] [-Scope] [<CommonParameters>]

Get-AzureRoleAssignment [-ResourceGroupName] [-RoleDefinitionName] [<CommonParameters>]

Get-AzureRoleAssignment [-ResourceGroupName] [-ResourceName] [-ResourceType] [-ParentResource] [-RoleDefinitionName] [<CommonParameters>]

Get-AzureRoleAssignment [-RoleDefinitionName] [-Scope] [<CommonParameters>]

Detailed Description

Filters role assignments.

Parameters

-RoleDefinitionName <String>

Role to assign the principals with.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-ObjectId <Guid>

Object id of the user, group or service principal.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-ResourceGroupName <String>

Resource group to assign the role to.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-ResourceName <String>

Name of the resource to assign the role to.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-ResourceType <String>

Type of the resource to assign the role to.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-ParentResource <String>

Parent resource of the resource to assign the role to, if there is any.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Scope <String>

Scope of the role assignment. In the format of relative URI. If not specified, will assign the role at subscription level. If specified, it can either start with "/subscriptions/{id}" or the part after that. If it's latter, the current subscription id will be used.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Mail <String>

Mail of the user or group

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-UserPrincipalName <String>

UPN of the user.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-ServicePrincipalName <String>

SPN of the service principal.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

Input Type


Return Type


Notes

Examples

-------------------------- Filters role assignment using UPN, Role Definition and Resource Group --------------------------

gets role assignments for principal in a resource group that have Reader role definition

PS C:\> Get-AzureRoleAssignment -ResourceGroupName rg1 -UPN foo@domain.com -RoleDefinitionName Reader

-------------------------- Filters role assignments using Service Principal Name --------------------------

Gets role assignments of a service principal that have contribution role definition.

PS C:\> Get-AzureRoleAssignment -ServicePrincipalName 36f81fc3-b00f-48cd-8218-3879f51ff39f -RoleDefinitionName Contributor

-------------------------- List all role assignments in the subscription --------------------------

Gets all role assignments under the subscription

PS C:\> Get-AzureRoleAssignment

-------------------------- Filters role assignment using explict Scope --------------------------

gets role assignment to a live email on a resource using the generic parameter. Since the scope doens't start with "/subscriptions/{id}", the current subscription id will be used

PS C:\> Get-AzureRoleAssignment -Mail allen.young@live.cn -RoleDefinitionName Owner -Scope "/resourcegroups/rg1/providers/Microsoft.Web/sites/site1"

New-AzureRoleAssignment
Remove-AzureRoleAssignment
Get-AzureRoleDefinition