編輯

共用方式為


New-AzRecoveryServicesVault

Creates a new Recovery Services vault.

Syntax

New-AzRecoveryServicesVault
   -Name <String>
   -ResourceGroupName <String>
   -Location <String>
   [-Tag <Hashtable>]
   [-DisableClassicAlerts <Boolean>]
   [-DisableAzureMonitorAlertsForJobFailure <Boolean>]
   [-PublicNetworkAccess <PublicNetworkAccess>]
   [-ImmutabilityState <ImmutabilityState>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzRecoveryServicesVault cmdlet creates a new Recovery Services vault.

Examples

Example 1

New-AzRecoveryServicesVault -Name "vaultName" -ResourceGroupName "rg" -Location "eastasia"

Create recovery service vault in resource group and given location.

Example 2: reate recovery service vault with ImmutabilityState, PublicNetworkAccess options

$tag= @{"tag1"="value1";"tag2"="value2"}
New-AzRecoveryServicesVault -Name "vaultName" -ResourceGroupName "resourceGroupName" -Location "westus" -Tag $tag -ImmutabilityState "Unlocked" -PublicNetworkAccess "Disabled"

Create recovery service vault with options like ImmutabilityState, PublicNetworkAccess. Please note Public Network Access is by default enabled for RS vault (if not specified) and can be updated using Update-AzRecoveryServicesVault cmdlet.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-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

-DisableAzureMonitorAlertsForJobFailure

Boolean paramter to specify whether built-in Azure Monitor alerts should be received for every job failure.

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisableClassicAlerts

Boolean paramter to specify whether backup alerts from the classic solution should be disabled or enabled.

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ImmutabilityState

Immutability State of the vault. Allowed values are "Disabled", "Unlocked", "Locked". Unlocked means Enabled and can be changed, Locked means Enabled and can't be changed.

Type:Nullable<T>[ImmutabilityState]
Accepted values:Disabled, Unlocked
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Location

Specifies the name of the geographic location of the vault.

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

-Name

Specifies the name of the vault to create.

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

-PublicNetworkAccess

Parameter to Enable/Disable public network access of the vault. This setting is useful with Private Endpoints.

Type:Nullable<T>[PublicNetworkAccess]
Accepted values:Enabled, Disabled
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

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

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

-Tag

Specifies the Tags to add to the Recovery Services Vault

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

-WhatIf

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

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

Inputs

None

Outputs

ARSVault