Randy Minder
Randy Minder

Reputation: 48522

Azure Virtual Machine Scale set - Check if stopped or started via Powershell

Azure has a number of Powershell cmdlets to work with virtual machine scale sets, such as Get-AzureRmVmss. However, I haven't found anything that enables me to determine if a vm scale set is stopped or started. Does anyone know this is possible within Powershell? I suspect it has to be but I'm at a loss to find the support.

Upvotes: 0

Views: 1627

Answers (1)

VIJAY RAAVI
VIJAY RAAVI

Reputation: 416

Use below PowerShell Cmdlet to get the Status of the Virtual Machine in the Virtual Machine Scale Set(VMSS)

(Get-AzureRmVmssVM -ResourceGroupName {ResourceGroup-Name} -VMScaleSetName {VMSS-Name} -InstanceView -InstanceId "{Instance-ID}").Statuses
Example:  (Get-AzureRmVmssVM -ResourceGroupName vmss-rg -VMScaleSetName myvmss -InstanceView -InstanceId "1").Statuses

enter image description here

Upvotes: 1

Related Questions