你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Update-AzKeyVaultManagedHsm

Update the state of an Azure managed HSM.

语法

UpdateByNameParameterSet (默认值)

Update-AzKeyVaultManagedHsm
    -Name <String>
    -ResourceGroupName <String>
    [-EnablePurgeProtection]
    [-PublicNetworkAccess <String>]
    [-UserAssignedIdentity <String[]>]
    [-Tag <Hashtable>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [-SubscriptionId <String>]
    [<CommonParameters>]

UpdateByInputObjectParameterSet

Update-AzKeyVaultManagedHsm
    -InputObject <PSManagedHsm>
    [-EnablePurgeProtection]
    [-PublicNetworkAccess <String>]
    [-UserAssignedIdentity <String[]>]
    [-Tag <Hashtable>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [-SubscriptionId <String>]
    [<CommonParameters>]

UpdateByResourceIdParameterSet

Update-AzKeyVaultManagedHsm
    -ResourceId <String>
    [-EnablePurgeProtection]
    [-PublicNetworkAccess <String>]
    [-UserAssignedIdentity <String[]>]
    [-Tag <Hashtable>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [-SubscriptionId <String>]
    [<CommonParameters>]

说明

This cmdlet updates the state of an Azure managed HSM.

示例

Example 1: Update a managed Hsm directly

Update-AzKeyVaultManagedHsm -Name $hsmName -ResourceGroupName $resourceGroupName -Tag @{testKey="testValue"} | Format-List
Managed HSM Name                    : testmhsm
Resource Group Name                 : testmhsm
Location                            : eastus2euap
Resource ID                         : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testmhsm/provid
                                      ers/Microsoft.KeyVault/managedHSMs/testmhsm
HSM Pool URI                        :
Tenant ID                           : xxxxxx-xxxx-xxxx-xxxxxxxxxxxx
Initial Admin Object Ids            : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SKU                                 : StandardB1
Soft Delete Enabled?                : True
Enabled Purge Protection?           : False
Soft Delete Retention Period (days) : 90
Provisioning State                  : Provisioning
Status Message                      : Resource creation in progress. Starting service...
Tags                                :
                                      Name        Value
                                      ====        =====
                                      testKey     testValued

Updates tags for the managed Hsm named $hsmName in resource group $resourceGroupName.

Example 2: Update a managed Hsm using piping

Get-AzKeyVaultManagedHsm -Name $hsmName -ResourceGroupName $resourceGroupName | Update-AzKeyVaultManagedHsm -Tag @{testKey="testValue"}

Updates tags for the managed Hsm using piping syntax.

Example 3: Enable purge protection for a managed Hsm

Update-AzKeyVaultManagedHsm -Name $hsmName -ResourceGroupName $resourceGroupName -EnablePurgeProtection | Format-List
Managed HSM Name                    : testmhsm
Resource Group Name                 : test-rg
Location                            : eastus
Resource ID                         : /subscriptions/a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/resourceGroups/test-rg/provide
                                      rs/Microsoft.KeyVault/managedHSMs/testmhsm
HSM Pool URI                        :
Tenant ID                           : aaaabbbb-0000-cccc-1111-dddd2222eeee
Initial Admin Object Ids            : {xxxxxx9e-5be9-4f43-abd2-xxxxxxxxxxxx}
SKU                                 : StandardB1
Soft Delete Enabled?                : True
Enabled Purge Protection?           : True
Soft Delete Retention Period (days) : 70
Provisioning State                  : Succeeded
Status Message                      : The Managed HSM is provisioned and ready to use.
Tags                                :

Enables purge protection for the managed Hsm named $hsmName in resource group $resourceGroupName.

Example 4: Update user assigned identity for a managed Hsm

Update-AzKeyVaultManagedHsm -Name testmhsm -ResourceGroupName test-rg -UserAssignedIdentity /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/bez-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/bez-id02 | Format-List
Managed HSM Name                        : testmshm
Resource Group Name                     : test-rg
Location                                : eastus2euap
Resource ID                             : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg/pro
                                          viders/Microsoft.KeyVault/managedHSMs/testmhsm
HSM Pool URI                            :
Tenant ID                               : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Initial Admin Object Ids                : {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
SKU                                     : StandardB1
Soft Delete Enabled?                    : True
Enabled Purge Protection?               : False
Soft Delete Retention Period (days)     : 70
Public Network Access                   : Enabled
IdentityType                            : UserAssigned
UserAssignedIdentities                  : /subscriptions/xxxx/resourceGroups/xxxx/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName
Provisioning State                      : Succeeded
Status Message                          : The Managed HSM is provisioned and ready to use.
Security Domain ActivationStatus        : Active
Security Domain ActivationStatusMessage : Your HSM has been activated and can be used for cryptographic operations.
Regions                                 :
Tags

This command adds an user assigned identity for the managed Hsm named testmshm in resource group test-rg.

参数

-Confirm

Prompts you for confirmation before running the cmdlet.

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False
别名:cf

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

参数属性

类型:IAzureContextContainer
默认值:None
支持通配符:False
不显示:False
别名:AzContext, AzureRmContext, AzureCredential

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-EnablePurgeProtection

specifying whether protection against purge is enabled for this managed HSM pool. The setting is effective only if soft delete is also enabled. Enabling this functionality is irreversible.

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-InputObject

Managed HSM object.

参数属性

类型:PSManagedHsm
默认值:None
支持通配符:False
不显示:False

参数集

UpdateByInputObjectParameterSet
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Name

Name of the managed HSM.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False
别名:HsmName

参数集

UpdateByNameParameterSet
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-PublicNetworkAccess

Controls permission for data plane traffic coming from public networks while private endpoint is enabled.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ResourceGroupName

Name of the resource group.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

UpdateByNameParameterSet
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ResourceId

Resource ID of the managed HSM.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

UpdateByResourceIdParameterSet
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-SubscriptionId

The ID of the subscription. By default, cmdlets are executed in the subscription that is set in the current context. If the user specifies another subscription, the current cmdlet is executed in the subscription specified by the user. Overriding subscriptions only take effect during the lifecycle of the current cmdlet. It does not change the subscription in the context, and does not affect subsequent cmdlets.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-Tag

A hash table which represents resource tags.

参数属性

类型:Hashtable
默认值:None
支持通配符:False
不显示:False
别名:Tags

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-UserAssignedIdentity

The set of user assigned identities associated with the managed HSM. Its value will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

参数属性

类型:

String[]

默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-WhatIf

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

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False
别名:wi

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值: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.

输入

PSManagedHsm

String

Hashtable

输出

PSManagedHsm