Get-AzureSiteRecoveryStorageMapping

Gets mappings of Site Recovery Storage objects for a 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

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

Description

The Get-AzureSiteRecoveryStorageMapping cmdlet gets mappings of Azure Site Recovery Storage objects for the current Azure Site Recovery vault.

Examples

Example 1: Get the mapping between a Storage object and a recovery Storage object

PS C:\> $Servers = Get-AzureSiteRecoveryServer
PS C:\> Get-AzureSiteRecoveryStorageMapping -PrimaryServer $Servers[0] -RecoveryServer $Servers[1]
PrimaryServerId     : 774859b0-1966-48cc-9df7-759c441b7a8c
PrimaryStorageId    : 1c1d0c0b-0c50-4675-af1a-1fdac70dbb6d
PrimaryStorageName  : phase2PrimaryStorageClassification
RecoveryServerId    : 774859b0-1966-48cc-9df7-759c441b7a8c
RecoveryStorageId   : 20cf8d92-fd5d-4872-985a-0f4562b8a0bf
RecoveryStorageName : phase2RecoveryStorageClassification

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 Azure Storage objects. The command specifies the primary server for the Storage object mapping as the first element of $Servers. The command specifies the server for the recovery Storage object as the second element of $Servers.

Parameters

-PrimaryServer

Specifies the primary server. To obtain a server, use the Get-AzureSiteRecoveryServer cmdlet.

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 the recovery server. To obtain a server, use Get-AzureSiteRecoveryServer.

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