New-​Azure​Site​Recovery​Network​Mapping

Creates a mapping between virtual networks.

Syntax

New-AzureSiteRecoveryNetworkMapping
   -AzureSubscriptionId <String>
   -AzureVMNetworkId <String>
   -PrimaryNetwork <ASRNetwork>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
New-AzureSiteRecoveryNetworkMapping
   -PrimaryNetwork <ASRNetwork>
   [-Profile <AzureSMProfile>]
   -RecoveryNetwork <ASRNetwork>
   [<CommonParameters>]

Description

The New-AzureSiteRecoveryNetworkMapping cmdlet creates a mapping between two virtual networks and returns an Azure Site Recovery job to track it.

Examples

Example 1: Create a mapping between a network and a recovery network

PS C:\> $Servers = Get-AzureSiteRecoveryServer
PS C:\> $Networks = Get-AzureSiteRecoveryNetwork -Server $Servers[0]
PS C:\> New-AzureSiteRecoveryNetworkMapping -PrimaryNetwork $Networks[0] -RecoveryNetwork $Networks[1]

The first command cmdlet gets servers for the current Azure Site Recovery vault by using the Get-AzureSiteRecoveryServer cmdlet. The command stores the Site Recovery servers in the $Servers array variable.

The second command gets the site recovery network for the first server in the $Servers array by using the Get-AzureSiteRecoveryNetwork cmdlet. The command stores the networks in the $Networks variable.

The final command creates a mapping between the primary network and the recovery network. The command specifies the primary network as the first element of $Networks. The command specifies the recovery network as the second element of $Networks.

Required Parameters

-AzureSubscriptionId

Specifies the ID of your Azure subscription.

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

Specifies the Azure virtual network ID.

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

Specifies the primary network object.

Type:ASRNetwork
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RecoveryNetwork

Specifies the recovery network object.

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

Optional Parameters

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

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