共用方式為


Update-AzureSiteRecoveryProtectionEntity

更新 Azure Site Recovery 中保護實體的屬性。

注意

本檔中參考的 Cmdlet 用於管理使用服務管理 API 的舊版 Azure 資源。 如需管理 Azure Resource Manager 資源的 Cmdlet,請參閱 Az PowerShell 模組

Syntax

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

Description

Update-AzureSiteRecoveryProtectionEntity Cmdlet 會更新 Azure Site Recovery 中保護實體的屬性,例如虛擬機器擁有者資訊。 此 Cmdlet 僅支援虛擬機器監視器 (VMM) 至 VMM 保護的保護實體。

範例

範例 1:更新保護實體

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           : {}

第一個命令會使用 Get-AzureSiteRecoveryProtectionContainer Cmdlet 取得受保護的容器,然後將該物件儲存在 $Container 變數中。

第二個命令會使用 Get-AzureSiteRecoveryProtectionEntity Cmdlet,取得屬於儲存在 $Container 容器的受保護虛擬機器,然後將它儲存在 $ProtectionEntity 變數中。

最後一個命令會更新 $ProtectionEntity 中的保護實體。

參數

-Profile

指定此 Cmdlet 從中讀取的 Azure 設定檔。 如果您未指定設定檔,此 Cmdlet 會從本機預設設定檔讀取。

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

-ProtectionEntity

指定要更新的保護實體。 若要取得 ASRProtectionEntity 物件,請使用 Get-AzureSiteRecoveryProtectionEntity Cmdlet。

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

-WaitForCompletion

表示此 Cmdlet 會先等候作業完成,再將控制權傳回 Windows PowerShell 主控台。

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