

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to check Azure VM Power state using PowerShell?
To check if the VMs are running, deallocated, or stopped using PowerShell, we need to use the - Status parameter.
If you write only the Get-AzVM command to get the VM details, it won’t show up the Azure VM power status default.
Example
To check the Azure VM Power Status,
Get-AzVM -status
Output
The above command will show the Power State for all VMs for that particular subscription. For different subscriptions, you need to change the subscription and run this command.
To get the VM Power State for the specific ResourceGroup, use the ResourceGroup name parameter.
Example
For example,
Get-AzVM -ResourceGroupName TestVMRG -Status
The above command will retrieve all VM Power states from the resource group TestVMRG.
Output
Example
For the specific VM Power state, you need to provide a particular VM name, as shown below.
Get-AzVM -VMName Win2k16vm1 -Status
Output
- Related Questions & Answers
- How to get the Power state of the Azure VM using PowerShell?
- How to deallocate the Azure VM using Azure CLI in PowerShell?
- How to stop the Azure VM using Azure CLI in PowerShell?
- How to start the Azure VM using Azure CLI in PowerShell?
- How to restart the Azure VM using Azure CLI in PowerShell?
- How to resize the Azure VM using Azure CLI in PowerShell?
- How to Export the azure VM tags using PowerShell?
- How to get Azure VM activity logs using PowerShell?
- How to get the Azure VM Size using Azure CLI in PowerShell?
- How to get the Azure VM username using Azure CLI in PowerShell?
- How to list the azure VM extensions using Azure CLI in PowerShell?
- How to add the tag of Azure VM using PowerShell?
- How to retrieve the Azure VM NIC name using PowerShell?
- How to get the Azure VM DNS name using PowerShell?
- How to retrieve the Azure VM vNet name using PowerShell?
Advertisements