Share via


Get-AzureSiteRecoveryVM

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

注意

このドキュメントで参照されているコマンドレットは、Service Management API を使用するレガシ Azure リソースを管理するためのものです。 Azure Resource Manager リソースを管理するためのコマンドレットについては、Az 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 を指定します。

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

-Name

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

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

-ProtectionContainer

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

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

-ProtectionContainerId

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

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