你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Update-AzureSiteRecoveryProtectionEntity
更新 Azure Site Recovery 中保护实体的属性。
注意
本文档中引用的 cmdlet 用于管理使用服务管理 API 的旧式 Azure 资源。 若要了解用于管理 Azure 资源管理器资源的 cmdlet,请参阅 Az PowerShell 模块。
语法
Update-AzureSiteRecoveryProtectionEntity
-ProtectionEntity <ASRProtectionEntity>
[-WaitForCompletion]
[-Profile <AzureSMProfile>]
[<CommonParameters>]
说明
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 |