Edit

Share via


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

ByObject (Default)

Get-AzureSiteRecoveryProtectionEntity
    -ProtectionContainer <ASRProtectionContainer>
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByObjectWithId

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

ByIDsWithId

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

ByObjectWithName

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

ByIDsWithName

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

ByIDs

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               : 00001111-aaaa-2222-bbbb-3333cccc4444
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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByObjectWithId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByIDsWithId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the name of a protection entity to get.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByObjectWithName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByIDsWithName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:AzureSMProfile
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProtectionContainer

Specifies a protection container.

Parameter properties

Type:ASRProtectionContainer
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByObject
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-ProtectionContainerId

Specifies the ID of a protected container.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByIDsWithId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByIDsWithName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByIDs
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.