Skip to content
Related Articles

Related Articles

Microsoft Azure – Retrieve Azure Virtual Machine Admin User Name

Improve Article
Save Article
  • Last Updated : 16 Dec, 2021
Improve Article
Save Article

In this article, you will get to know, how you can find an azure Virtual machine admin user name in crucial situations to recover an azure VM Username. Purpose – this username will help you to reset an azure VM password in the absence of Admin or else if some forget or In case of verifying the username.


Follow the below steps to find Azure VM Admin user name:

Step 1: Log in to Azure Portal. 

Step 2: Open Cloud Shell >> select PowerShell.

Step 3: Copy the below Azure PowerShell Command and Paste the command in the cloud shell console.

Get-AZVM -Name "Provide_the_Azure_VM_Name_Here" | Select-Object -ExpandProperty OSProfile

For Example: 

Get-AZVM -Name "CloudOps-VM1" | Select-Object -ExpandProperty OSProfile

If you want to filter from a specific Resource Group then use the below command

Get-AZVM `
-Name "Provide_the_Azure_VM_Name_Here" `
-ResourceGroup "Provide_Resource_Group_Name_Here" `
| Select-Object -ExpandProperty OSProfile


That’s it, you are done. This way we can retrieve the user name of an Azure VM adminstrator.

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!