Get-​Azure​Rm​Key​Vault

Gets key vaults.

Syntax

Get-AzureRmKeyVault
   [-VaultName] <String>
   [-Location] <String>
   [-InRemovedState]
   [<CommonParameters>]
Get-AzureRmKeyVault
   [-InRemovedState]
   [<CommonParameters>]
Get-AzureRmKeyVault
   [-VaultName] <String>
   [[-ResourceGroupName] <String>]
   [<CommonParameters>]
Get-AzureRmKeyVault
   [-ResourceGroupName] <String>
   [<CommonParameters>]
Get-AzureRmKeyVault
   [-Tag <Hashtable>]
   [<CommonParameters>]

Description

The Get-AzureRmKeyVault cmdlet gets information about the key vaults in a subscription. You can view all key vaults instances in a subscription, or filter your results by a resource group or a particular key vault.

Note that although specifying the resource group is optional for this cmdlet when you get a single key vault, you should do so for better performance.

Examples

Example 1: Get all key vaults in your current subscription

PS C:\>Get-AzureRMKeyVault

This command gets all the key vaults in your current subscription.

Example 2: Get a specific key vault

PS C:\>$MyVault = Get-AzureRMKeyVault -VaultName 'Contoso03Vault'

This command gets the key vault named Contoso03Vault in your current subscription, and then stores it in the $MyVault variable. You can inspect the properties of $MyVault to get details about the key vault.

Example 3: Get key vaults in a resource group

PS C:\>Get-AzureRmKeyVault -ResourceGroupName 'ContosoPayRollResourceGroup'

This command gets all the key vaults in the resource group named ContosoPayRollResourceGroup.

Example 4: Get all deleted key vaults in your current subscription

PS C:\>Get-AzureRmKeyVault -InRemovedState

This command gets all the deleted key vaults in your current subscription.

Example 5: Get a deleted key vault

PS C:\>Get-AzureRMKeyVault -VaultName 'Contoso03Vault'  -Location 'eastus2' -InRemovedState

This command gets the deleted key vault information named Contoso03Vault in your current subscription and in eastus2 region.

Required Parameters

-InRemovedState

Specifies whether to show the previously deleted vaults in the output.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Location

The location of the deleted vault.

Type:String
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-VaultName

Specifies the name of the key vault.

Type:String
Aliases:Name
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-ResourceGroupName

Specifies the name of the resource group associated with the key vault or key vaults being queried.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Tag

Specifies the key and value of the specified tag to filter the list of key vaults by hash table.

Type:Hashtable
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False