- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 retrieve the Azure VM resource group using PowerShell?
To retrieve the azure VM resource group using PowerShell, we first need to retrieve the Azure VM details using Get-AZVm and then we can use its property called ResourceGroup.
Before getting the details of the Azure VM, make sure that you are connected to the Azure Account using the Connect-AzAccount command.
In this example, we are going to retrieve the Azure VM named TestMachine2k16 to retrieve the VM details.
$azvm = Get-AzVM -Name TestMachine2k16
To get the resource group name, use its property ResourceGroupName.
PS C:\> $azvm.ResourceGroupName ANSIBLETESTRG
- Related Articles
- How to retrieve the Azure VM network security group (NSG) using PowerShell?
- How to retrieve the Azure VM Subscription Name using PowerShell?
- How to retrieve the Azure VM NIC name using PowerShell?
- How to retrieve the Azure VM vNet name using PowerShell?
- How to retrieve the Azure VM deallocated date using PowerShell?
- How to delete the Azure Resource Group using PowerShell?
- How to retrieve the Azure VM nic name using Azure CLI in PowerShell?
- How to retrieve the OS of the Azure VM using Azure CLI in PowerShell?
- How to get the Azure resource group using Azure CLI in PowerShell?
- How to retrieve the Operating system of the Azure VM using PowerShell?
- How to retrieve the Azure VM RAM and CPU size using PowerShell?
- How to retrieve the OS caching setting of Azure VM using Azure\nCLI in PowerShell?
- How to create a new Azure resource group using PowerShell?
- How to apply a tag to the azure resource group using PowerShell?
- How to get the azure resources from the resource group using PowerShell?

Advertisements