Skip navigation
computers

View All Virtual Machines in an Availability Set

Q: How can I quickly view all virtual machines in my Azure subscription that are part of an Availability Set?

A: The following PowerShell code will list all virtual machines within a subscription that are part of an Availability Set.

(Get-AzureService).servicename | foreach {Get-AzureVM -ServiceName $_ } | 
Where-Object {$_.AvailabilitySetName –ne $null } | 
Select name,AvailabilitySetName |
Format-Table Name, AvailabilitySetName -AutoSize
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish