- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- 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 get the Azure VM username using Azure CLI in PowerShell?
To get the Azure VM username using Az CLI, we need to use the below command.
PS C:\> az vm show -n AzVM -g ResourceGroup --query '[osProfile.adminUsername]' -otsv
The above command will retrieve the Azure VM username. You can also use the below command to retrieve the Azure VM username without knowing the resource group name.
PS C:\> az vm list --query "[?name=='vmname'].osProfile.adminUsername" -otsv
Before running the above commands, make sure that you are connected to the Azure cloud and the specific Azure Subscription.
Advertisements
To Continue Learning Please Login
Login with Google