我正在为我的客户编写脚本,似乎ASR PowerShell模块不工作。
我需要通过PowerShell连接到Azure并获取受保护项目的列表。(复制的项目)。
有人试过吗?我尝试使用Az和AzureRM模块。
发布于 2020-10-21 18:24:57
请注意,AzureRM PowerShell模块的所有版本都已过时,但并未因此而不受支持。Az PowerShell模块现在是推荐用于与Azure交互的PowerShell模块。
不过,下面是来自这两个模块的cmdlet:
Get-AzureRmSiteRecoveryReplicationProtectedItem
Get-AzureRmSiteRecoveryReplicationProtectedItem
-ProtectionContainer <ASRProtectionContainer>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]Get-AzRecoveryServicesAsrReplicationProtectedItem
Get-AzRecoveryServicesAsrReplicationProtectedItem
-ProtectionContainer <ASRProtectionContainer>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]发布于 2021-08-30 13:10:34
首先授权到Azure,然后执行以下操作:
$VaultName = 'name-of-recovery-service-vault'
$vault = Get-AzRecoveryServicesVault -Name $VaultName
Set-AzRecoveryServicesAsrVaultContext -Vault $vault
$fabric = Get-AzRecoveryServicesAsrFabric
$container = Get-AzRecoveryServicesAsrProtectionContainer -Fabric $fabric
Get-AzRecoveryServicesAsrReplicationProtectedItem -ProtectionContainer $containerhttps://stackoverflow.com/questions/62327894
复制相似问题