How to find Azure VM applied backup protection policy name via Powershell

血红的双手。 提交于 2020-01-06 06:06:22

问题


How to find which azure backup protection policy applied on specific Azure virtual machine via Powershell

Get- AzureRmRecoveryServicesBackupProtectionPolicy asking for policyname but there are many policy under one service vault.

thanks!


回答1:


You could use following script.

##Replace Recovery service vault name
Get-AzureRmRecoveryServicesVault -Name "shui" | Set-AzureRmRecoveryServicesVaultContext

##FriendlyName is your Azure VM name
$namedContainer=Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" -Status "Registered" -FriendlyName "shui"

$item = Get-AzureRmRecoveryServicesBackupItem -Container $namedContainer -WorkloadType "AzureVM"
$item.ProtectionPolicyName


来源:https://stackoverflow.com/questions/47511805/how-to-find-azure-vm-applied-backup-protection-policy-name-via-powershell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!