Open In App

Microsoft Azure – Check Status of Azure VM using Azure PowerShell

Last Updated : 30 Mar, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The following Azure PowerShell command helps you to find the Azure VM Config and properties details of Os Name, Os Version, Hyper V Generation, Disks properties, Extensions properties of Type Handler Version, Status and Message, VM Agents properties of Type Handler Version, Status and Message and also VM Power Status Codes, Messages, Plugins, Time Generated,…etc.

Azure PowerShell Command:

Get-AzVM -Name "vm_name" -ResourceGroup "resource_group_name"  -status

Example: 

Get-AzVM -Name "CloudOpsVM" -ResourceGroup "Cloud-Operations"  -status

It returns the properties of the complete in-depth status of an Azure VM. The properties consist of Resource Group Name, VM Computer Name, VM Host Name, OS Name, Os Version, Hyper V Generation, VM Disks Properties, VM Extensions Properties,…etc.

Note: To get the Azure VM properties VM should be in the running state,

Example 1: When the VM is in Running State the Status looks like the following (refer to sample output data and sample output image).

Sample Output Data:

ResourceGroupName       : Cloud-Operations
Name                    : CloudOpsVM
ComputerName            : CloudOpsVM
OsName                  : Windows Server 2019 Datacenter
OsVersion               : 10.0.17763.2183
HyperVGeneration        : V2
BootDiagnostics         :
Disks[0]                :
  Name                  : CloudOpsVM_OsDisk_1_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
  Statuses[0]           :
    Code                : ProvisioningState/succeeded
    Level               : Info
    DisplayStatus       : Provisioning succeeded
    Time                : 1/3/2022 6:21:20 PM
Extensions[0]           :
  Name                  : AzureNetworkWatcherExtension
  Type                  : Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows
  TypeHandlerVersion    : 1.4.2059.1
  Statuses[0]           :
    Code                : ProvisioningState/succeeded
    Level               : Info
    DisplayStatus       : Provisioning succeeded
    Message             : Default configuration is in effect.
Extensions[1]           :
  Name                  : DependencyAgentWindows
  Type                  : Microsoft.Azure.Monitoring.DependencyAgent.DependencyAgentWindows
  TypeHandlerVersion    : 9.10.12.18430
  Statuses[0]           :
    Code                : ProvisioningState/succeeded
    Level               : Info
    DisplayStatus       : Provisioning succeeded
    Message             : Plugin enabled (handler name: Microsoft.Azure.Monitoring.DependencyAgent.DependencyAgentWindows, extension name: , version: 9.10.12.18430).
Extensions[2]           :
  Name                  : MicrosoftMonitoringAgent
  Type                  : Microsoft.EnterpriseCloud.Monitoring.MicrosoftMonitoringAgent
  TypeHandlerVersion    : 1.0.18064.0
  Statuses[0]           :
    Code                : ProvisioningState/succeeded
    Level               : Info
    DisplayStatus       : Provisioning succeeded
    Message             : Latest configuration has been applied to the Microsoft Monitoring Agent.
VMAgent                 :
  VmAgentVersion        : 2.7.41491.1032
  ExtensionHandlers[0]  :
    Type                : Microsoft.Azure.AzureDefenderForServers.MDE.Windows
    TypeHandlerVersion  : 1.0.3.1
    Status              :
      Code              : ProvisioningState/succeeded
      Level             : Info
      DisplayStatus     : Ready
      Message           : Plugin enabled (handler name: Microsoft.Azure.AzureDefenderForServers.MDE.Windows, extension name: , version: 1.0.3.1).
  ExtensionHandlers[1]  :
    Type                : Microsoft.Azure.Monitoring.DependencyAgent.DependencyAgentWindows
    TypeHandlerVersion  : 9.10.12.18430
    Status              :
      Code              : ProvisioningState/succeeded
      Level             : Info
      DisplayStatus     : Ready
      Message           : Plugin enabled (handler name: Microsoft.Azure.Monitoring.DependencyAgent.DependencyAgentWindows, extension name: , version: 9.10.12.18430).
  ExtensionHandlers[2]  :
    Type                : Microsoft.Azure.NetworkWatcher.NetworkWatcherAgentWindows
    TypeHandlerVersion  : 1.4.2059.1
    Status              :
      Code              : ProvisioningState/succeeded
      Level             : Info
      DisplayStatus     : Ready
  ExtensionHandlers[3]  :
    Type                : Microsoft.Azure.RecoveryServices.VMSnapshot
    TypeHandlerVersion  : 1.0.71.0
    Status              :
      Code              : ProvisioningState/succeeded
      Level             : Info
      DisplayStatus     : Ready
  ExtensionHandlers[4]  :
    Type                : Microsoft.EnterpriseCloud.Monitoring.MicrosoftMonitoringAgent
    TypeHandlerVersion  : 1.0.18064.0
    Status              :
      Code              : ProvisioningState/succeeded
      Level             : Info
      DisplayStatus     : Ready
      Message           : This virtual machine has successfully connected to Azure Log Analytics.
  Statuses[0]           :
    Code                : ProvisioningState/succeeded
    Level               : Info
    DisplayStatus       : Ready
    Message             : GuestAgent is running and processing the extensions.
    Time                : 1/3/2022 6:24:34 PM
Statuses[0]             :
  Code                  : ProvisioningState/succeeded
  Level                 : Info
  DisplayStatus         : Provisioning succeeded
  Time                  : 1/3/2022 6:23:12 PM
Statuses[1]             :
  Code                  : PowerState/running
  Level                 : Info
  DisplayStatus         : VM running

Sample Output Image:

Example 2: When Azure VM is in Deallocated State the Status looks like the following (refer sample output).

Sample Output:


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads