none
List VMs in all Recovery Groups RRS feed

  • Question

  • Hi Gurus

    Is there an Azure CLI or PowerShell command that I can run to list all VMs that appear in all of my Recovery Groups (I have many).

    thanks K

    Thursday, January 9, 2020 2:06 PM

All replies

  • Hi,

    Have you tried the Get-AzureRmSiteRecoveryVM PowerShell cmdlet?

    Best regards,
    Leon


    Blog: https://thesystemcenterblog.com LinkedIn:

    Thursday, January 9, 2020 3:25 PM
  • Hello,

    You can use PowerShell cmdlet Get-AzVM

    That will give you the list of all VMs in that subscription.

    If you run in from the Cloud Shell, you will already be logged in and AZ PowerShell module will be installed. In case that you want to run it from your local computer, you first need to install PowerShell AZ module.

    When you have module installed, you can connect your PowerShell console to your Azure subscription by running Connect-AzAccount. You will be prompted to enter your credentials and that will log you in to your Azure subscription.

    Then run Get-AzVM and you will get a list of all VMs in your entire subscription. That list can be exported to CSV or copied from there.

    There are many things that you can do with PowerShell and information that you can connect.

    Please let me know if this worked for you or if you need any additional information.

    Vukasin Terzic

    Thursday, January 9, 2020 4:02 PM