Share via


Get-AzureRmRoleDefinition

Lists all Azure RBAC roles that are available for assignment.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

RoleDefinitionNameParameterSet

Get-AzureRmRoleDefinition
    [[-Name] <String>]
    [-Scope <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

RoleDefinitionIdParameterSet

Get-AzureRmRoleDefinition
    -Id <Guid>
    [-Scope <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

RoleDefinitionCustomParameterSet

Get-AzureRmRoleDefinition
    [-Scope <String>]
    [-Custom]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

Use the Get-AzureRmRoleDefinition command with a particular role name to view its details. To inspect individual operations that a role grants access to, review the Actions and NotActions properties of the role.

Examples

Example 1

PS C:\> Get-AzureRmRoleDefinition -Name Reader

Get the Reader role definition

Example 2

PS C:\> Get-AzureRmRoleDefinition

Lists all RBAC role definitions

Parameters

-Custom

If specified, only displays the custom created roles in the directory.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RoleDefinitionCustomParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

Role definition Id.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RoleDefinitionIdParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Name

Role definition name. For e.g. Reader, Contributor, Virtual Machine Contributor.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RoleDefinitionNameParameterSet
Position:0
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Scope

Role definition scope.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

Parameters: Scope (ByValue)

Guid

SwitchParameter

Outputs

PSRoleDefinition

Notes

Keywords: azure, azurerm, arm, resource, management, manager, resource, group, template, deployment