Get-AzKeyVaultManagedHsm

Get managed HSMs.

Syntax

Get-AzKeyVaultManagedHsm
   [[-Name] <String>]
   [[-ResourceGroupName] <String>]
   [-Tag <Hashtable>]
   [-DefaultProfile <IAzureContextContainer>]
   [-SubscriptionId <String>]
   [<CommonParameters>]
Get-AzKeyVaultManagedHsm
   [-Name] <String>
   [-Location] <String>
   [-InRemovedState]
   [-Tag <Hashtable>]
   [-DefaultProfile <IAzureContextContainer>]
   [-SubscriptionId <String>]
   [<CommonParameters>]
Get-AzKeyVaultManagedHsm
   [-InRemovedState]
   [-Tag <Hashtable>]
   [-DefaultProfile <IAzureContextContainer>]
   [-SubscriptionId <String>]
   [<CommonParameters>]

Description

The Get-AzKeyVaultManagedHsm cmdlet gets information about the managed HSMs in a subscription. You can view all managed HSMs instances in a subscription, or filter your results by a resource group or a particular managed HSM. Note that although specifying the resource group is optional for this cmdlet when you get a single managed HSM, you should do so for better performance.

Examples

Example 1: Get all managed HSMs in your current subscription

Get-AzKeyVaultManagedHsm

Name    Resource Group Name Location SKU        ProvisioningState Security Domain ActivationStatus
----    ------------------- -------- ---        ----------------- --------------------------------
myhsm   test-rg              eastus   StandardB1 Succeeded         Active

This command gets all managed HSMs in your current subscription.

Example 2: Get a specific managed HSM

Get-AzKeyVaultManagedHsm -Name 'myhsm'

Name    Resource Group Name Location SKU        ProvisioningState Security Domain ActivationStatus
----    ------------------- -------- ---        ----------------- --------------------------------
myhsm   test-rg              eastus   StandardB1 Succeeded         Active

This command gets the managed HSM named myhsm in your current subscription.

Example 3: Get managed HSMs in a resource group

Get-AzKeyVaultManagedHsm -ResourceGroupName 'myrg1'

Name  Resource Group Name Location    SKU        ProvisioningState Security Domain ActivationStatus
----  ------------------- --------    ---        ----------------- --------------------------------
myhsm myrg1               eastus2euap StandardB1 Succeeded         Active

This command gets all managed HSMs in the resource group named myrg1.

Example 4: Get managed HSMs using filtering

Get-AzKeyVaultManagedHsm -Name 'myhsm*'

Name  Resource Group Name Location    SKU        ProvisioningState Security Domain ActivationStatus
----  ------------------- --------    ---        ----------------- --------------------------------
myhsm myrg1               eastus2euap StandardB1 Succeeded         Active

This command gets all managed HSMs in the subscription that start with "myhsm".

Example 5: List deleted managed HSMs

Get-AzKeyVaultManagedHsm -InRemovedState

Name                     Location      DeletionDate           ScheduledPurgeDate    Purge Protection Enabled?
----                     --------      ------------           ------------------    -------------------------
xxxxxxxx-mhsm-4op2n2g4xe eastus2       12/30/2021 2:29:00 AM  3/30/2022 2:29:00 AM  True
xxxxxxx-mhsm-ertopo7tnxa westus        12/29/2021 11:48:42 PM 3/29/2022 11:48:42 PM True
xxxxxxx-mhsm-gg66fgctz67 westus        12/29/2021 11:48:42 PM 3/29/2022 11:48:42 PM False
xxxxxxx-mhsm-2m5jiop6mfo westcentralus 12/30/2021 12:26:14 AM 3/30/2022 12:26:14 AM True

This command gets all deleted managed HSMs in current subscription.

Parameters

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InRemovedState

Specifies whether to show the previously deleted managed HSM pool in the output.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Location

The location of the deleted managed HSM pool.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

HSM name. Cmdlet constructs the FQDN of a HSM based on the name and currently selected environment.

Type:String
Aliases:HsmName
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:True

-ResourceGroupName

Specifies the name of the resource group associated with the managed HSM being queried.

Type:String
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:True

-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.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Tag

Specifies the key and optional value of the specified tag to filter the list of managed HSMs by.

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

Hashtable

Outputs

PSManagedHsm

PSDeletedManagedHsm

PSKeyVaultIdentityItem