Remove-AzureSiteRecoveryNetworkMapping

Removes a network mapping from 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

Remove-AzureSiteRecoveryNetworkMapping
      -NetworkMapping <ASRNetworkMapping>
      [-Profile <AzureSMProfile>]
      [<CommonParameters>]

Description

The Remove-AzureSiteRecoveryNetworkMapping cmdlet removes a network mapping from the current Azure Site Recovery vault.

Examples

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

PS C:\> $Servers = Get-AzureSiteRecoveryServer
PS C:\> $NetworkMapping = Get-AzureSiteRecoveryNetworkMapping -PrimaryServer $Servers[0] -RecoveryServer $Servers[0]
PS C:\> Remove-AzureSiteRecoveryNetworkMapping -NetworkMapping $NetworkMapping

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, and then stores it in the $NetworkMapping variable. 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.

The final command removes the network mapping in $NetworkMapping.

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

PS C:\> $Servers = Get-AzureSiteRecoveryServer
PS C:\> $NetworkMapping = Get-AzureSiteRecoveryNetworkMapping -PrimaryServer $Servers[0] -Azure
PS C:\> Remove-AzureSiteRecoveryNetworkMapping -NetworkMapping $NetworkMapping

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

The second command gets a mapping between the primary network and an Azure virtual machine network, and then stores it in the $NetworkMapping variable. 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.

The final command removes the network mapping in $NetworkMapping.

Parameters

-NetworkMapping

Specifies the network mapping to remove.

Type:ASRNetworkMapping
Position:Named
Default value:None
Required:True
Accept pipeline input:True
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