如何通过Powershell查找Azure VM应用的备份保护策略名称 [英] How to find Azure VM applied backup protection policy name via Powershell

查看:86
本文介绍了如何通过Powershell查找Azure VM应用的备份保护策略名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何查找通过Powershell应用于特定Azure虚拟机的哪种Azure备份保护策略

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

Get- AzureRmRecoveryServicesBackupProtectionPolicy询问策略名称,但一个服务库下有许多策略.

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

谢谢!

推荐答案

您可以使用以下脚本.

##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

这篇关于如何通过Powershell查找Azure VM应用的备份保护策略名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆