Update-AzureSiteRecoveryProtectionEntity

Updates the properties of a protection entity in Azure Site Recovery.

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

Update-AzureSiteRecoveryProtectionEntity
      -ProtectionEntity <ASRProtectionEntity>
      [-WaitForCompletion]
      [-Profile <AzureSMProfile>]
      [<CommonParameters>]

Description

The Update-AzureSiteRecoveryProtectionEntity cmdlet updates the properties of a protection entity in Azure Site Recovery, such as virtual machine owner information. This cmdlet is supported only for Virtual Machine Monitor (VMM) to VMM protected protection entities.

Examples

Example 1: Update a protection entity

PS C:\> $Container = Get-AzureSiteRecoveryProtectionContainer
PS C:\> $ProtectionEntity = Get-AzureSiteRecoveryProtectionEntity -ProtectionContainer $Container
PS C:\> Update-AzureSiteRecoveryProtectionEntity -ProtectionEntity $ProtectionEntity
           Name             : 
           ID               : 680ffe0f-6236-465e-8c94-81242fa67e6d
           ClientRequestId  : 2c47e6ce-1460-4187-8a0f-b9073735fa38-2014-12-30 06:44:40Z-P
           State            : NotStarted
           StateDescription : NotStarted
           StartTime        : 
           EndTime          : 
           AllowedActions   : {}
           Tasks            : {}
           Errors           : {}

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 stored in $Container by using the Get-AzureSiteRecoveryProtectionEntity cmdlet, and then stores it in the $ProtectionEntity variable.

The final command updates the protection entity in $ProtectionEntity.

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

-ProtectionEntity

Specifies a protection entity to update. To obtain an ASRProtectionEntity object, use the Get-AzureSiteRecoveryProtectionEntity cmdlet.

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

-WaitForCompletion

Indicates that this cmdlet waits for the operation to complete before it returns control to the Windows PowerShell console.

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