Remove-AzureSiteRecoveryStorageMapping

Removes a Storage object mapping for a Site Recovery vault.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

Remove-AzureSiteRecoveryStorageMapping
      -StorageMapping <ASRStorageMapping>
      [-Profile <AzureSMProfile>]
      [<CommonParameters>]

Description

The Remove-AzureSiteRecoveryStorageMapping cmdlet removes a Storage object mapping for 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:\> $StorageMapping = Get-AzureSiteRecoveryStorageMapping -PrimaryServer $Servers[0] -RecoveryServer $Servers[1]
PS C:\> Remove-AzureSiteRecoveryStorageMapping -StorageMapping $StorageMapping
Get-AzureSiteRecoveryServerGet-AzureSiteRecoveryStorageMappingNew-AzureSiteRecoveryStorageMapping

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 two Storage objects, and then stores it in the $StorageMapping 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 mapping in $StorageMapping.

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

-StorageMapping

Specifies a network mapping. To obtain an ASRStorageMapping, use the Get-AzureSiteRecoveryStorage cmdlet.

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