< Back

Remove-AzureRmRoleDefinition

Tue Jan 29, 2019 10:06 pm

NAME Remove-AzureRmRoleDefinition



SYNOPSIS

Deletes a custom role in Azure RBAC. The role to be deleted is specified using the Id property of the role. Delete will fail if there are existing

role assignments made to the custom role.





SYNTAX

Remove-AzureRmRoleDefinition [-DefaultProfile <IAzureContextContainer>] [-Force] -Id <Guid> [-PassThru] [-Scope <String>] [-Confirm] [-WhatIf]

[<CommonParameters>]



Remove-AzureRmRoleDefinition [-Name] <String> [-DefaultProfile <IAzureContextContainer>] [-Force] [-PassThru] [-Scope <String>] [-Confirm]

[-WhatIf] [<CommonParameters>]





DESCRIPTION

The Remove-AzureRmRoleDefinition cmdlet deletes a custom role in Azure Role-Based Access Control. Provide the Id parameter of an existing

custom role to delete that custom role. By default, Remove-AzureRmRoleDefinition prompts you for confirmation. To suppress the prompt, use the

Force parameter. If there are existing role assignments made to the custom role to be deleted, the delete will fail.





PARAMETERS

-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Force [<SwitchParameter>]

If set, does not prompt for a confirmation before deleting the custom role



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Id <Guid>

Id of the Role definition to be deleted



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Name <String>

Name of the Role definition to be deleted.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-PassThru [<SwitchParameter>]





Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Scope <String>

Role definition scope.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]





Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

System.Boolean







NOTES





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



Example 1



Get-AzureRmRoleDefinition -Name "Virtual Machine Operator" | Remove-AzureRmRoleDefinition









Example 2



Remove-AzureRmRoleDefinition -Id "52a6cc13-ff92-47a8-a39b-2a8205c3087e"











RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... definition

New-AzureRmRoleDefinition

Get-AzureRmRoleDefinition

Set-AzureRmRoleDefinition