Remote Desktop: Error when logging in with Microsoft account

Problems connecting Remote Desktop, when using a Microsoft account.

Today I wanted to connect from my Microsoft Surface to my Thinkpad, using RDP. Unfortunately, the login did not work, I only got the message that the connection cannot be established.

Your credentials did not work. The logon attempt failed.

Basically, when logging in using Remote Desktop and Microsoft account, use the password of the Microsoft account, not the PIN that is used to log in to the computer.

I did this, but the login still did not work. Maybe it was because I had just recently changed my account?

The solution in this case is to open a command prompt and enter the following command:

runas /u:MicrosoftAccount\somebody@somecompany.com cmd.exe

The e-mail address must be adjusted according to the Microsoft account. After entering, we will be asked for the password.

Done! Then we can try the login again, now it should work.

13 comments

  1. Thank you for the tip.
    Do you have any idea why I cannot type my password into the command prompt? No characters are entered.
    Cheers.

  2. Hi Andy, I’m having a frustrating time with trying to do the RDC. I had the same problems you did and eventually had to change my Microsoft password. I checked that it worked within my Microsoft account but still could not get the RDC to connect. Then I found your very clear video and followed all the steps. But in the command prompt I keep getting: “the user name or password is incorrect”. It isn’t, I have very very carefully checked and typed it several times.
    Any ideas?

    1. I would assume that you have to rerun the following command:

      runas /u:MicrosoftAccount\somebody@somecompany.com cmd.exe

      Did you do that?

      Andy

      1. Hi, i have the same issue as this, i put the same password but it gives me and error saying either the password or username is wrong, i even changed my password and it still wont work.

        Thanks 🙂

        1. I cannot give a definitive answer to that, but on youtube there are a few comments about that, I suggest also look at those, here is one tip:

          “To the people still having the issue even after trying this. Go to account settings (Simply open start menu, click on your name, then select Change account settings), in there, just sign off from microsoft account (not the windows account, just microsoft account in the options), and re-sign into your microsoft account. That should fix the issue..”

  3. Does anyone know why this works? My guess is this only happens to users who have configured Windows to log in with a Microsoft account instead of a local account and that the runas command forces Windows to associate said Microsoft account with RPC/DCOM/WMI and/or whatever else Windows uses for Remote Desktop. This trick also helped me fix the shutdown command not working for remotely shutting down one of my machines. Remote shutdown did work for the machine where I had previously run this which is what gave me the idea to try it. So many thanks to you Andy!

    1. Hi Dogen,

      Thanks for your comment! Yes, you’re spot on — this usually happens when using a Microsoft account instead of a local one. The `runas` command forces Windows to properly register the account for background services like Remote Desktop, WMI, or remote shutdown. Glad it helped you too!

      Best,
      Andy

Leave a Reply

Your email address will not be published. Required fields are marked *