azureazure-powershellazure-backup-vault

how to check if back up is enabled on azure virtual machine using powershell


How to check if back up is enabled on an Azure virtual machine using PowerShell?

I am aware of querying all the virtual machines and then comparing with the Virtual machines configured under Recovery services vault.

Is there any way to pull the information from the Virtual machine object? OR an easier way than I already have?


Solution

  • Use the Get-AzureRmRecoveryServicesBackupContainer cmdlet and pipe that to the Get-AzureRmRecoveryServicesBackupItem cmdlet to list the Backup enabled VMs under the recovery services vault.

    For more information refer: https://learn.microsoft.com/en-us/azure/backup/backup-azure-vms-automation#select-the-vm