PowerShell Get-AzureRmBackupProtectionPolicy command error

Category: azure backup


Chies on Thu, 30 Aug 2018 13:37:32

Hello team,

I need a help, today I try use this cmdlet: Get-AzureRmBackupProtectionPolicy, to get informations about backup policy on my account and returned this error:

Get-AzureRmBackupProtectionPolicy : Cannot bind parameter 'Vault'. Cannot convert the "napit" value of type "System.String" to type "http://Microsoft.Azure .Commands.AzureBackup.Models.AzureRMBackupVault".

I'm based on this article Get-AzureRmBackupProtectionPolicy, but all the possibilities are done and the same error occour.

Tks so much for your help.


Sandeep BR on Thu, 30 Aug 2018 19:37:32

Are you using the latest PowerShell module, if not try to update the PowerShell (6.8.1) and do the activity from the documentation. You can also have look into the below PowerShell cmdlets.

$Vault = Get-AzureRmBackupVault -Name "Vault03"
Set-AzureRmRecoveryServicesVaultContext -Vault $Vault
Get-AzureRmBackupProtectionPolicy -Vault $Vault

Mike Ubezzi (Azure) on Thu, 30 Aug 2018 19:49:13

Hi Chies,

Can you type 'get-host' in your Powershell terminal window. Which version do you currently have installed?

With version 'Version: 5.1.17134.228', the Get-AzureRmBackupProtectionPolicy cmdlet is recognized but, with Version: 6.1.0-rc.1 it does not.

Here I am using the Cloud Shell (Powershell) interface in the Azure Portal:

And here it is working on my local installation:

SadiqhAhmed-MSFT on Tue, 04 Sep 2018 07:28:47

@Chies, Checking in if you have had a chance to see the previous response. We need the above requested information to further assist you on this issue.