New-AzRecoveryServicesAsrProtectionContainerMapping

Creates an Azure Site Recovery Protection Container mapping by associating the specified replication policy to the specified ASR protection container.

Syntax

New-AzRecoveryServicesAsrProtectionContainerMapping
   -Name <String>
   -Policy <ASRPolicy>
   -PrimaryProtectionContainer <ASRProtectionContainer>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzRecoveryServicesAsrProtectionContainerMapping
   -Name <String>
   -Policy <ASRPolicy>
   -PrimaryProtectionContainer <ASRProtectionContainer>
   -RecoveryProtectionContainer <ASRProtectionContainer>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzRecoveryServicesAsrProtectionContainerMapping cmdlet creates an Azure Site Recovery Protection Container mapping by associating the specified replication policy to the specified protection container.

Examples

Example 1

PS C:\> New-AzRecoveryServicesAsrProtectionContainerMapping -Name $ContainerMappingName -Policy $ProtectionProfile -PrimaryProtectionContainer $PrimaryContainer -RecoveryProtectionContainer $RecoveryContainer

Name             : 1f32fee1-05d0-4c11-a997-1618e14b4dab
ID               : /Subscriptions/xxxxxxxxxxxx/resourceGroups/canaryexproute/providers/Microsoft.RecoveryServices/vaults/IbizaV2ATest/replicationJobs/1f32fee1-05d0-4c11-a997-1618e14b4dab
Type             :
JobType          :
DisplayName      :
ClientRequestId  : 2870d5ab-f9be-405e-87d5-5bf20387c623 ActivityId: 24b28fc5-509b-4ad3-92c0-c8bb7ced7fb6
State            : NotStarted
StateDescription : NotStarted
StartTime        :
EndTime          :
TargetObjectId   :
TargetObjectType :
TargetObjectName :
AllowedActions   :
Tasks            : {}
Errors           : {}

Starts the creation of the protection container mapping with the specified parameters, and returns the ASR job used to track the operation.

Example 2

PS C:\> New-AzRecoveryServicesAsrProtectionContainerMapping -Name $PrimaryProtectionContainerMapping -policy $Policy1 -PrimaryProtectionContainer $pc

Name             : 1f32fee1-05d0-4c11-a997-1618e14b4dab
ID               : /Subscriptions/xxxxxxxxxxxx/resourceGroups/canaryexproute/providers/Microsoft.RecoveryServices/vaults/IbizaV2ATest/replicationJobs/1f32fee1-05d0-4c11-a997-1618e14b4dab
Type             :
JobType          :
DisplayName      :
ClientRequestId  : 2870d5ab-f9be-405e-87d5-5bf20387c623 ActivityId: 24b28fc5-509b-4ad3-92c0-c8bb7ced7fb6
State            : NotStarted
StateDescription : NotStarted
StartTime        :
EndTime          :
TargetObjectId   :
TargetObjectType :
TargetObjectName :
AllowedActions   :
Tasks            : {}
Errors           : {}

Starts the creation of the protection container mapping with the specified parameters, and returns the ASR job used to track the operation.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-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 Protection Container mapping.

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

Specifies the ASR replication policy object for the replication policy to be used in the mapping.

Type:ASRPolicy
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-PrimaryProtectionContainer

Specifies the ASR protection container object for the primary protection container to be used in the mapping.

Type:ASRProtectionContainer
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RecoveryProtectionContainer

Specifies the ASR protection container object for the recovery protection container to be used in the mapping (used if replicating to a recovery location that is not Azure.)

Type:ASRProtectionContainer
Position:Named
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False

Inputs

ASRPolicy

Outputs

ASRJob