Get-AzureSiteRecoveryProtectionEntity

Gets protectable or protected entities in a Site Recovery vault.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

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>]

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.

Parameters

-Id

Specifies the ID of a protection entity to get.

Type:String
Position:Named
Default value:None
Required:True
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
Required:True
Accept pipeline input:False
Accept wildcard characters:False

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

-ProtectionContainer

Specifies a protection container.

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

-ProtectionContainerId

Specifies the ID of a protected container.

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