Home > front end >  error while getting asr replication items details in azure powershell
error while getting asr replication items details in azure powershell

Time:10-21

I'm using azure PowerShell to get the replicated item details using the below code, as per the documentation the program is correct but it's giving an error as below.

$VaultName = 'Site-recovery-vault-westus'
$vault = Get-AzRecoveryServicesVault -Name $VaultName
Set-AzRecoveryServicesAsrVaultContext -Vault $vault
$fabric = Get-AzRecoveryServicesAsrFabric
$container = Get-AzRecoveryServicesAsrProtectionContainer -Fabric $fabric
Get-AzRecoveryServicesAsrReplicationProtectedItem -ProtectionContainer $container

At 5th line Error: Get-AzRecoveryServicesAsrProtectionContainer: Cannot convert 'System.Object[]' to the type 'Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.ASRFabric' required by parameter 'Fabric'. Specified method is not supported.

CodePudding user response:

We have tested in our local environment, Below observations are based on your analysis.

By using the shared cmdlets, we able to pull the AzRecoveryServicesAsrProtectionContainer in the recovery service vault.

$fabric = Get-AzRecoveryServicesAsrFabric

As per the enter image description here

  • Related