View All Virtual Machines in an Availability Set

View all virtual machines in a subscription that are part of an Availability Set.

John Savill

January 12, 2015

1 Min Read
computers

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

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like