共用方式為


Update-AzureSiteRecoveryProtectionEntity

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

注意

本文件中參考的 Cmdlet 用於管理使用 Azure Service Manager(ASM) API 的舊版 Azure 資源。 建立新的資源時,不建議使用此舊版 PowerShell 模組,因為 ASM 已排定淘汰。 如需詳細資訊,請參閱 Azure Service Manager 淘汰

Az PowerShell 模組是使用 PowerShell 管理 Azure Resource Manager (ARM) 資源的建議 PowerShell 模組。

語法

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 會從本機預設配置檔讀取。

類型:AzureSMProfile
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ProtectionEntity

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

類型:ASRProtectionEntity
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-WaitForCompletion

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

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False