首页 > 解决方案 > 如何从 Azure Site Recover 获取所有受保护项目的详细信息

问题描述

我正在为我的客户编写脚本,但似乎 ASR PowerShell 模块无法正常工作。

我需要通过 PowerShell 连接到 Azure 并获取受保护项目的列表。(复制项目)。

有人试过这样做吗?我尝试使用 Az 和 AzureRM 模块。

标签: azurepowershellazure-powershellazure-site-recovery

解决方案


请注意, AzureRM PowerShell 模块的所有版本都已过时,但并未失去支持。Az PowerShell 模块现在是推荐用于与 Azure 交互的 PowerShell 模块。

不过,这里是来自两个模块的 cmdlet:

Get-AzureRmSiteRecoveryReplicationProtectedItem
   -ProtectionContainer <ASRProtectionContainer>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzRecoveryServicesAsrReplicationProtectedItem
   -ProtectionContainer <ASRProtectionContainer>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

推荐阅读