Get-AzRecoveryServicesVault
Gets a list of Recovery Services vaults.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
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
Get-AzRecoveryServicesVault
Get the list of vault in selected subscription.
Example 2
Get-AzRecoveryServicesVault -ResourceGroupName "resourceGroup"
Get the list of vault in resource group in selected subscription.
Example 3
$vault = Get-AzRecoveryServicesVault -ResourceGroupName "resourceGroup" -Name "vaultName"
$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
The credentials, account, tenant, and subscription used for communication with azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the name of the vault to query for.
| Type: | String |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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 |
Specifies the Tags to query for
| Type: | Hashtable |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the Key of the Tag to query for
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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
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.