Share via


Update-AzureSiteRecoveryProtectionDirection

Site Recovery オブジェクトを保護するために、ソース サーバーとターゲット サーバーを更新します。

注意

このドキュメントで参照されているコマンドレットは、Service Management API を使用するレガシ Azure リソースを管理するためのものです。 Azure Resource Manager リソースを管理するためのコマンドレットについては、Az PowerShell モジュールを参照してください。

構文

Update-AzureSiteRecoveryProtectionDirection
      -RecoveryPlan <ASRRecoveryPlan>
      -Direction <String>
      [-WaitForCompletion]
      [-Profile <AzureSMProfile>]
      [<CommonParameters>]
Update-AzureSiteRecoveryProtectionDirection
      -RPId <String>
      -Direction <String>
      [-WaitForCompletion]
      [-Profile <AzureSMProfile>]
      [<CommonParameters>]
Update-AzureSiteRecoveryProtectionDirection
      -ProtectionEntityId <String>
      -ProtectionContainerId <String>
      -Direction <String>
      [-WaitForCompletion]
      [-Profile <AzureSMProfile>]
      [<CommonParameters>]
Update-AzureSiteRecoveryProtectionDirection
      -ProtectionEntity <ASRProtectionEntity>
      -Direction <String>
      [-WaitForCompletion]
      [-Profile <AzureSMProfile>]
      [<CommonParameters>]

説明

Update-AzureSiteRecoveryProtectionDirection コマンドレットは、コミット フェールオーバー操作が完了した後、Azure Site Recovery オブジェクトを保護するためにソース サーバーとターゲット サーバーを更新します。

例 1: コンテナー内の保護されたオブジェクトの方向を変更する

PS C:\> $Container = Get-AzureSiteRecoveryProtectionContainer 
PS C:\> $Protected = Get-AzureSiteRecoveryProtectionEntity -ProtectionContainer $Container  
PS C:\> Update-AzureSiteRecoveryProtectionDirection -Direction RecoveryToPrimary -ProtectionEntity $Protected 
ID               : c38eecdc-731c-405b-a61c-08db99aae2fe
ClientRequestId  : 32ace403-0916-4967-83a1-529176bd6e88-2014-49-06 15:49:24Z-P
State            : NotStarted
StateDescription : NotStarted
StartTime        : 
EndTime          : 
AllowedActions   : {}
Name             : 
Tasks            : {}
Errors           : {}

最初のコマンドは、Get-AzureSiteRecoveryProtectionContainer コマンドレットを使用して現在の Azure Site Recovery コンテナー内の保護されたコンテナーを取得し、$Container変数に格納します。

2 番目のコマンドは、Get-AzureSiteRecoveryProtectionEntity コマンドレットを使用して、$Containerに格納されているコンテナーに属する仮想マシンを取得します。 このコマンドは、結果を $Protected 変数に格納します。

最後のコマンドは、$Protectedに格納されているオブジェクトの RecoverToPrimary への方向を設定します。

パラメーター

-Direction

コミットの方向を指定します。 このパラメーターの有効値は、次のとおりです。

  • PrimaryToRecovery
  • RecoveryToPrimary
Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Profile

このコマンドレットが読み取る Azure プロファイルを指定します。 プロファイルを指定しない場合、このコマンドレットはローカルの既定のプロファイルから読み取ります。

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

-ProtectionContainerId

保護されたコンテナーの ID を指定します。 このコマンドレットは、このパラメーターが指定するコンテナーに属する保護された仮想マシンの方向を変更します。

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

-ProtectionEntity

保護エンティティ オブジェクトを指定します。

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

-ProtectionEntityId

保護された仮想マシンの ID を指定します。 このコマンドレットは、このパラメーターが指定する保護された仮想マシンの方向を変更します。

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

-RecoveryPlan

復旧計画オブジェクトを指定します。

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

-RPId

復旧計画の ID を指定します。 このコマンドレットは、このパラメーターが指定する復旧計画の方向を変更します。

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

-WaitForCompletion

Windows PowerShell コンソールに制御を返す前に、コマンドレットが操作の完了を待機することを示します。

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