问题
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