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
 

Remove-AzureRoleAssignment

Remove-AzureRoleAssignment

microsoft.azure.commands.resources.dll

Synopsis

Removes a role assignment.

Syntax

Remove-AzureRoleAssignment [-ObjectId] [-ResourceGroupName] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Remove-AzureRoleAssignment [-ObjectId] [-ResourceGroupName] [-ResourceName] [-ResourceType] [-ParentResource] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Remove-AzureRoleAssignment [-ObjectId] [-Scope] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Remove-AzureRoleAssignment [-ObjectId] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Remove-AzureRoleAssignment [-Mail] [-Scope] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Remove-AzureRoleAssignment [-Mail] [-ResourceGroupName] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Remove-AzureRoleAssignment [-Mail] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Remove-AzureRoleAssignment [-Mail] [-ResourceGroupName] [-ResourceName] [-ResourceType] [-ParentResource] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Remove-AzureRoleAssignment [-UserPrincipalName] [-Scope] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Remove-AzureRoleAssignment [-UserPrincipalName] [-ResourceGroupName] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Remove-AzureRoleAssignment [-UserPrincipalName] [-ResourceGroupName] [-ResourceName] [-ResourceType] [-ParentResource] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Remove-AzureRoleAssignment [-UserPrincipalName] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Remove-AzureRoleAssignment [-ServicePrincipalName] [-ResourceGroupName] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Remove-AzureRoleAssignment [-ServicePrincipalName] [-ResourceGroupName] [-ResourceName] [-ResourceType] [-ParentResource] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Remove-AzureRoleAssignment [-ServicePrincipalName] [-Scope] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Remove-AzureRoleAssignment [-ServicePrincipalName] [-RoleDefinitionName] [-Force] [-PassThru] [<CommonParameters>]

Detailed Description

Removes a role assignments.

Parameters

-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

-RoleDefinitionName <String>

Role to assign the principals with.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Force <SwitchParameter>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-PassThru <SwitchParameter>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

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

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

Removes a role assignment for principal in a resource group that have Reader role definition

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

New-AzureRoleAssignment
Get-AzureRoleAssignment
Get-AzureRoleDefinition