Get-AzRecoveryServicesVault

Gets a list of Recovery Services vaults.

Syntax

Get-AzRecoveryServicesVault
   [[-ResourceGroupName] <String>]
   [[-Name] <String>]
   [-TagName <String>]
   [-TagValue <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzRecoveryServicesVault
   [[-ResourceGroupName] <String>]
   [[-Name] <String>]
   -Tag <Hashtable>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzRecoveryServicesVault cmdlet gets a list of Recovery Services vaults in the current subscription.

Examples

Example 1

PS C:\> Get-AzRecoveryServicesVault

Get the list of vault in selected subscription.

Example 2

PS C:\> Get-AzRecoveryServicesVault -ResourceGroupName "resourceGroup"

Get the list of vault in resource group in selected subscription.

Example 3

PS C:\> $vault = Get-AzRecoveryServicesVault -ResourceGroupName "resourceGroup" -Name "vaultName"
PS C:\> $vault.Identity | fl

PrincipalId : XXXXXXXX-XXXX-XXXX
TenantId    : XXXXXXXX-XXXX-XXXX
Type        : SystemAssigned

The first cmdlet gets the vault in resource group with given name. Then we access the MSI information from the vault.

Parameters

-DefaultProfile

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies the name of the vault to query for.

Type:String
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of the Azure resource group from which to retrieve the specified Recovery Services object.

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

Specifies the Tags to query for

Type:Hashtable
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TagName

Specifies the Key of the Tag to query for

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TagValue

Specifies the Value of the Tag to query for

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

Inputs

None

Outputs

ARSVault

Notes

Get-AzRecoveryServicesVault in old version of Az.RecoveryServices(<=2.10.0) cannot work with Az.Accounts(>=1.8.1) because of incorrect assembly reference. The module Az.RecoveryServices needs to be upgraded to 2.11.0 or newer if you are using the latest Az or Az.Accounts.