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
0 comments
Hide comments