Reputation: 1046
My laptop is not working, so I'm trying to create an rdp connection to my azure VM on another computer. I do remember the password but not the username. Where can I find it?
Upvotes: 24
Views: 94584
Reputation: 1225
There is a simpler way. First select your virtual machine, and then at right top corner, click on Json View (1) and here you can see your username (2),
Upvotes: 0
Reputation: 1
I found a way to get the user name for an existing VM -
Go to the windows VM – Select Export Template from the left under Automation -> Choose Deploy -> Choose Edit Template -> Then from the template you can search for “adminUsername” and you can find the Username from there. VM_Username
Upvotes: 0
Reputation: 612
Actually you can see it, Windows or Linux VM's:
1. Through VM resource --> Connect --> SSH
2. Also, you can use "Run command" for virtual machine Linux:
, and for virtual machine on Windows:
3. You can use PowerShell:
Get-AZVM -Name *vmname* | Select-Object -ExpandProperty OSProfile
You can also use Serial Console down in Support + troubleshooting in case you experiencing issues with RDP or SSH connection. Or reset your password with Reset password in the same block.
Upvotes: 13
Reputation: 1
I was looking for an answer as wlel as and the best solution for me was to run Powershell command Get-Localuser. Run using the RUN Command on the VM.
The fix RDP issue did not work for me and as soon I got my username I was in.
Might be an old post but might help others because I did not see a single post with this information.
Upvotes: 0
Reputation: 11
You can get your username from PowerShell or Azure CLI:
az login
(az vm list | ConvertFrom-Json).osProfile.adminUsername
Azure CLI Reference: https://learn.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest
Upvotes: 1
Reputation: 30903
Here is a good article on how to change the build-in Admin accounts credentials. Try with this approach, as there is no other way to get your user name.
Upvotes: 0
Reputation: 1066
[Update] - [26 March 2020] Now with updated Azure screens and view, we do not have option to retrieve Azure VM username from portal but there is a workaround.
[OLD ANSWER - Not Valid Now]: While troubleshooting I tried to find the newly created VM's username with below steps, I hope this will help someone.
1) Go to "Virtual Machines" section on your Azure portal.
2) Select your newly created Virtual Machine name.
3) Click on the "Connect" link just next to the "Start" in the selection bar.
4) There will be a new blade opened for you on the right, with two tabs "RDP" and "SSH".
5) Select the "SSH", there next to the "Login using your VM local account" you find ssh yourusername@"VM's IP address".
you can use yourusername to login to the machine with required password.
Upvotes: 37
Reputation: 55
It is visible when you try to connect to your vm using ssh as mentioned in above answer. You can also find it under "Automation Scripts" tab. Under Automation script -> Template, search for "adminUsername"
Upvotes: 0
Reputation: 41
You can also find username in Home > Resource groups > XXXX - Deployments and click Template. This Template will be a json key value pair file. Refer to the attached screenshot.
You can also click on Outputs above Template and it will provide you with adminusername.
Upvotes: 2
Reputation: 1168
Just check the "Login using VM local account" field. It will have the username of your VM
Upvotes: 5
Reputation: 738
I hope you were able to find your username in 3 years. I have the same issue and found the solution. Answering for new comers.
Just click "configure" button on the VM overview page.
Upvotes: 6