Get-AzureSiteRecoveryVM

Site Recovery で管理される仮想マシンに関する情報を取得します。

Note

このドキュメントで参照されているコマンドレットは、Azure Service Manager (ASM) API を使用する従来の Azure リソースを管理するためのものです。 ASM の提供終了が予定されているため、新しいリソースを作成する場合、このレガシ PowerShell モジュールは推奨されません。 詳細については、Azure Service Manager の提供終了に関するページを参照してください

Az PowerShell モジュールは、PowerShell を使用して Azure Resource Manager (ARM) リソースを管理するために推奨される PowerShell モジュールです。

構文

Get-AzureSiteRecoveryVM
   -ProtectionContainer <ASRProtectionContainer>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
Get-AzureSiteRecoveryVM
   -Id <String>
   -ProtectionContainer <ASRProtectionContainer>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
Get-AzureSiteRecoveryVM
   -Id <String>
   -ProtectionContainerId <String>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
Get-AzureSiteRecoveryVM
   -Name <String>
   -ProtectionContainer <ASRProtectionContainer>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
Get-AzureSiteRecoveryVM
   -Name <String>
   -ProtectionContainerId <String>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
Get-AzureSiteRecoveryVM
   -ProtectionContainerId <String>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

説明

Get-AzureSiteRecoveryVM コマンドレットは、Azure Site Recovery で管理されている仮想マシンに関する情報を取得します。

例 1: 仮想マシンに関する情報を取得する

PS C:\> $ProtectionContainer = Get-AzureSiteRecoveryProtectionContainer
PS C:\> Get-AzureSiteRecoveryVM -ProtectionContainer $ProtectionContainer
ID                          : a205fd17-3848-4896-bab6-9dbccc3cd8ed
ServerId                    : 4a94c4a9-c856-4577-afbd-367fe9b3ce9c
ProtectionContainerId       : 4a94c4a9-c856-4577-afbd-367fe9b3ce9c_1c513d45-645d-4ed0-b9ae-e7b869a1f7fc
Name                        : vm1
Type                        : VirtualMachine
FabricObjectId              : 86447b9e-d877-4e9a-8302-adcd6bbf18c0
Protected                   : False
CanCommit                   : False
CanFailover                 : True
CanReverseReplicate         : False
ActiveLocation              : Primary
ProtectionState             : Enabled
ReplicationHealth           : Healthy
TestFailoverState           : None
ReplicationProvider         : HyperVReplica

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

2 番目のコマンドは、$ProtectionContainer内の仮想マシンに関する情報を取得します。

パラメーター

-Id

情報を取得する仮想マシンの ID を指定します。

型:String
配置:Named
規定値:None
必須:True
パイプライン入力を受け取る:False
ワイルドカード文字を受け取る:False

-Name

仮想マシンの名前を指定します。

型:String
配置:Named
規定値:None
必須:True
パイプライン入力を受け取る:False
ワイルドカード文字を受け取る:False

-Profile

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

型:AzureSMProfile
配置:Named
規定値:None
必須:False
パイプライン入力を受け取る:False
ワイルドカード文字を受け取る:False

-ProtectionContainer

Site Recovery 保護コンテナー オブジェクトを指定します。

型:ASRProtectionContainer
配置:Named
規定値:None
必須:True
パイプライン入力を受け取る:True
ワイルドカード文字を受け取る:False

-ProtectionContainerId

情報を取得する保護されたコンテナーの ID を指定します。

型:String
配置:Named
規定値:None
必須:True
パイプライン入力を受け取る:False
ワイルドカード文字を受け取る:False