Edit

Share via


Remove-AzKeyVaultRoleDefinition

Removes a custom role definition from an HSM.

Syntax

ByName (Default)

Remove-AzKeyVaultRoleDefinition
    [-HsmName] <String>
    -RoleName <String>
    [-Scope <String>]
    [-Force]
    [-PassThru]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

InputObject

Remove-AzKeyVaultRoleDefinition
    [-HsmName] <String>
    -InputObject <PSKeyVaultRoleDefinition>
    [-Scope <String>]
    [-Force]
    [-PassThru]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Remove-AzKeyVaultRoleDefinition cmdlet deletes a custom role in Azure Role-Based Access Control of Azure KeyVault managed HSM. Provide the -RoleName parameter of an existing custom role or a role object to delete that custom role. By default, Remove-AzKeyVaultRoleDefinition prompts you for confirmation. To suppress the prompt, use the -Force parameter.

Examples

Example 1

Remove-AzKeyVaultRoleDefinition -HsmName myHsm -RoleName "my role"

This example removes a custom role named "my role".

Example 2

$role = Get-AzKeyVaultRoleDefinition -HsmName myHsm -RoleName "my role"
$role | Remove-AzKeyVaultRoleDefinition -HsmName myHsm -Force

This example removes a custom role named "my role" by piping the role object. It also suppress the prompt by -Force.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
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:AzContext, 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

-Force

Do not ask for confirm.

Parameter properties

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

Parameter sets

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

-HsmName

Name of the HSM.

Parameter properties

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

Parameter sets

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

-InputObject

The object representing the role definition to be removed.

Parameter properties

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

Parameter sets

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

-PassThru

This cmdlet does not return an object by default. If this switch is specified, it returns true if successful.

Parameter properties

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

Parameter sets

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

-RoleName

Name of the role definition to get.

Parameter properties

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

Parameter sets

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

-Scope

Scope at which the role assignment or definition applies to, e.g., '/' or '/keys' or '/keys/{keyName}'.

Parameter properties

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

Parameter sets

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
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

PSKeyVaultRoleDefinition

Outputs

Boolean