Get-AzureSiteRecoveryNetworkMapping

Gets network mappings for a Site Recovery vault.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Service Management APIs. See the Az PowerShell module for cmdlets to manage Azure Resource Manager resources.

Syntax

Get-AzureSiteRecoveryNetworkMapping
   -PrimaryServer <ASRServer>
   -RecoveryServer <ASRServer>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
Get-AzureSiteRecoveryNetworkMapping
   -PrimaryServer <ASRServer>
   [-Azure]
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

Description

The Get-AzureSiteRecoveryNetworkMapping cmdlet gets information about Azure Site Recovery network mappings for the current Site Recovery vault.

Examples

Example 1: Get the mapping between a network and a recovery network

PS C:\> $Servers = Get-AzureSiteRecoveryServer
PS C:\> Get-AzureSiteRecoveryNetworkMapping -PrimaryServer $Servers[0] -RecoveryServer $Servers[0]
PrimaryServerId     : 774859b0-1966-48cc-9df7-759c441b7a8c
PrimaryNetworkId    : 7cfd636e-5cc2-4e01-873b-8a7aa4962341
PrimaryNetworkName  : phase2RecoveryVMNetwork
RecoveryServerId    : 774859b0-1966-48cc-9df7-759c441b7a8c
RecoveryNetworkId   : d903e2c6-3141-4cef-bfe1-04616cd43cbb
RecoveryNetworkName : phase2PrimaryVMNetwork
PairingStatus       : OK

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 mapping between the primary network and the recovery network. The command specifies the primary server for the network mapping as the first element of $Servers. The command specifies the server for the recovery network as the second element of $Servers.

Example 2: Get the mapping between a network and an Azure virtual machine network

PS C:\> $Servers = Get-AzureSiteRecoveryServer
PS C:\> Get-AzureSiteRecoveryNetworkMapping -Azure -PrimaryServer $Servers[0] 
PrimaryServerId     : 774859b0-1966-48cc-9df7-759c441b7a8c
PrimaryNetworkId    : 7cfd636e-5cc2-4e01-873b-8a7aa4962341
PrimaryNetworkName  : phase2RecoveryVMNetwork
RecoveryServerId    : 21a9403c-6ec1-44f2-b744-b4e50b792387
RecoveryNetworkId   : ecb3a462-664f-4f57-873e-d09b5925e1a1
RecoveryNetworkName : AzureVMNetwork
PairingStatus       : OK

The first command cmdlet gets servers for the current Site Recovery vault. The command stores the servers in the $Servers array variable.

The second command gets a mapping between the primary network and an Azure virtual machine network. The command specifies the primary server for the network as the first element of $Servers. The command specifies the Azure parameter. Therefore, the command gets the mapping to an Azure virtual machine network.

Parameters

-Azure

Indicates that this cmdlet gets network mappings for networks on the primary server mapped to Azure virtual networks.

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

-PrimaryServer

Specifies a primary server for which to get mappings.

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

-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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RecoveryServer

Specifies a recovery server for which to get mappings.

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