I've had an Azure Windows VM running on my free monthy credits for over a year now, to try stuff and play around in the cloud. I never had problems before.

For a few days now, I can't connect via rdp. It just doesn't work, although I'm sure I typed my password right on the 20th try.

So I tried to reset the password and configuration using Azure Portal. This always end in an error saying

"VMAccss extension does not work with domain controller"

I do know the VM is running, as I can access the website on it.

I restarted it a few times, and even redeployed it, but no dice.

What do I do now?


So Jason's solution was the one I used to solve my little access problem, so it is marked as such.

Azure changed over time though, so now there is an (IMO) actually better solution to this problem, posted by jmbertucci below.

  • So your VM is also a Domain Controller? Dec 18, 2017 at 10:25
  • Nope. Although I am also interested in knowing what somebody with a domain controller would do in this situation. Dec 18, 2017 at 11:26
  • @Metallkiller Does that work for you? please let me know if you need more help:)
    – Jason Ye
    Dec 28, 2017 at 7:06

3 Answers 3


We should check does RDP service running? we can use telnet to test RDP service running or not.
Have you check your VM's public IP address(changed or not)?

"VMAccss extension does not work with domain controller"

If you want to change the password, we can use custom script extension to reset password:

1.Create ps1 file in your local PC, name as resetpw.ps1 :

net user username newpassword

2.deploy new custom script extension, upload ps1 file to Azure via Azure portal: enter image description here

3.check the extension status:

enter image description here

Now, we can use new password to login your Azure VM.

  • Sorry for the very late reply. This one helped me actually solve my problem back then. May 4, 2020 at 11:13

Thanks to Jason Ye's excellent answer (that has helped me in the past), it seems there's another way to run a Powershell script on your Azure VM from the Azure VM website portal.

Click on your VM in the portal.

Choose Run Command from the menu options (under Operations).

Choose RunPowerShellScript from the list of command options.

In the Powershell script modal, add Jason's PS script to run and press Run.

net user username newpassword

enter image description here

Hopefully, this will be easy and helpful to anyone else who loses their VM password, knows the username and has still has access to the Azure Portal.


ps. With the changes Azure has gone through, I couldn't find the Custom Script Extension resource anymore, as mentioned in the other answer.

It's probably there but renamed or moved around somewhere. That's what lead me to find an alternative solution.

This one felt a little more straight forward as well.

  • 1
    Nice, this would have been even easier. I still had to mark Jason's answer as solution, since that is what I actually did to solve my problem (and forgot to mark back then), but my upvote is yours, and I will mention your solution in an edit! May 4, 2020 at 11:09

Can you attached the system VHD to another VM and reset the password that way? Pretty sure I've read that's the approach for Linux VMs as Azure doesn't provide console access to reset that way - my Windows knowledge isn't too deep but pretty sure you can then reset the password once mounted on another server.

Edit: Quick google suggests you can https://docs.microsoft.com/en-us/azure/virtual-machines/windows/reset-local-password-without-agent

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .