Get-​Azure​Site​Recovery​Protection​Entity

Gets protectable or protected entities in a Site Recovery vault.

Syntax

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

Description

The Get-AzureSiteRecoveryProtectionEntity cmdlet gets the protectable or protected entities, such as virtual machines, in the current Azure Site Recovery vault.

Examples

Example 1: Display a protected virtual machine in a container

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               : 506B3CAC-5758-49E2-98C4-E5B0512E4D8E
Protected                    : False
CanCommit                    : False
CanFailover                  : False
CanReverseReplicate          : False
ActiveLocation               : Primary
ProtectionStateDescription   : Enabling protection
ReplicationHealth            : 
TestFailoverStateDescription : Nonev
ReplicationProvider          : HyperVReplica

The first command gets a protected container by using the Get-AzureSiteRecoveryProtectionContainer cmdlet, and then stores that object in the $Container variable.

The second command gets the protected virtual machine that belongs to the container in $Container, and then displays it.

Required Parameters

-Id

Specifies the ID of a protection entity to get.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies the name of a protection entity to get.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ProtectionContainer

Specifies a protection container.

Type:ASRProtectionContainer
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-ProtectionContainerId

Specifies the ID of a protected container.

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

Optional Parameters

-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
Accept pipeline input:False
Accept wildcard characters:False