Is there a way to list all the VMS listed in recovery vault using powershell?
I've been hunting around online and have only seen commands to manage virtual machines but not list them. I'm trying to list all the protected VMS and the last backup date. If it's possible.
Thanks in advance :)
We can use PowerShell to list VMs in the recovery service vault and the latest recovery point, like this:
My VMs name are
jasonvm
andjasonvm2
.=============================================
Update:
If we have many VMs, we can use
Foreach
to list Azure VMName
andLatestRecoveryPoint
, we can use this script:I'm having trouble with the
Set-AzureRmRecoveryServicesVaultContext
command (Powershell 6.0 with AZ Module). it seems it will be deprecated to set the context as suggested here: KB MSjust add the
-vaultID
value to the Jason's command, eg: