次の方法で共有


Get-AzureSiteRecoveryProtectionEntity

Site Recovery コンテナー内の保護可能なエンティティまたは保護されたエンティティを取得します。

Note

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

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

構文

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

説明

Get-AzureSiteRecoveryProtectionEntity コマンドレットは、現在の Azure Site Recovery コンテナー内の保護可能または保護されたエンティティ (仮想マシンなど) を取得します。

例 1: コンテナーに保護された仮想マシンを表示する

PS C:\> $Container = Get-AzureSiteRecoveryProtectionContainer
PS C:\> Get-AzureSiteRecoveryProtectionEntity -ProtectionContainer $Container 
ID                           : 43aaab46-1cb0-4c39-8077-9a091c3b05ce
ServerId                     : 4a94c4a9-c856-4577-afbd-367fe9b3ce9c
ProtectionContainerId        : 4a94c4a9-c856-4577-afbd-367fe9b3ce9c_1c513d45-645d-4ed0-b9ae-e7b869a1f7fc
Name                         : testvm
Type                         : VirtualMachine
FabricObjectId               : 00001111-aaaa-2222-bbbb-3333cccc4444
Protected                    : False
CanCommit                    : False
CanFailover                  : False
CanReverseReplicate          : False
ActiveLocation               : Primary
ProtectionStateDescription   : Enabling protection
ReplicationHealth            : 
TestFailoverStateDescription : Nonev
ReplicationProvider          : HyperVReplica

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

2 番目のコマンドは、$Container内のコンテナーに属している保護された仮想マシンを取得し、それを表示します。

パラメーター

-Id

取得する保護エンティティの ID を指定します。

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

-Name

取得する保護エンティティの名前を指定します。

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

-Profile

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

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

-ProtectionContainer

保護コンテナーを指定します。

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

-ProtectionContainerId

保護されたコンテナーの ID を指定します。

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