New-AzureRmRecoveryServicesAsrProtectionContainerMapping
Creates an Azure Site Recovery Protection Container mapping by associating the specified replication policy to the specified ASR protection container.
Warning
The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.
Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.
Syntax
New-AzureRmRecoveryServicesAsrProtectionContainerMapping
-Name <String>
-Policy <ASRPolicy>
-PrimaryProtectionContainer <ASRProtectionContainer>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzureRmRecoveryServicesAsrProtectionContainerMapping
-Name <String>
-Policy <ASRPolicy>
-PrimaryProtectionContainer <ASRProtectionContainer>
-RecoveryProtectionContainer <ASRProtectionContainer>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzureRmRecoveryServicesAsrProtectionContainerMapping 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-AzureRmRecoveryServicesAsrProtectionContainerMapping -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-AzureRmRecoveryServicesAsrProtectionContainerMapping -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 |
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: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Specifies the name of the Protection Container mapping.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
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 |
Required: | True |
Accept pipeline input: | True |
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 |
Required: | True |
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 |
Required: | True |
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 |