Today, one of my client had problem while he was trying to connect to a remote computer to work. The remote desktop on his Windows XP (Related Post : If you have MSLicensing Problem on Windows Vista, then check this post.) was running fine, but now he was getting this error:

“The remote computer disconnected the session because of an error in the licensing protocol. Please try connecting to the remote computer again or contact your server administrator.”

When I looked up in the knowledge base, this is what Microsoft had to say :

“Cause: The licensing protocol handles the communication of licensing information between your computer and the remote computer. If there is an error in the licensing protocol, your computer cannot be connected to the remote computer.

Solution: Try connecting to the remote computer again. If you continue to receive this error message, contact the server administrator”

Well here’s the solution to fix this problem:

This actually is a registry fix. You’ll be prompted to delete a few keys and subkeys and hence it’s better if you take a back up of your registry manually, so that you can restore it if something goes wrong during the process.

If you do not know how to take back up of your registry manually follow this tutorial : Tutorial to to back up the registry in Windows Vista or in Windows XP.

Once you have taken the back up,

1> Click on Start Menu –> Go to Run Command box –> Type regedit –> This opens the registry Editor.

2> Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing

How to fix -  The Remote Computer Disconnected the session because of an error in the Licensing protocol

3> Delete all the keys under MSLicensing : both HardwareID and Store keys and their subkeys. If you are not sure how to delete the key and its subkeys, just rename them as follows : HardwareID to HardwareID-temp and Store to Store-temp.

4> Reboot the system. Rebooting will create new Keys under HardwareID and Store and this will fix your problems.

5> If you had renamed the keys and subkeys instead of deleting them, navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing and you’ll the two newly created folders – HardwareID and Store. Delete the old HardwareID-temp and Store-temp and close the registry editor.

That’s it !

Recommended reading: Registry tweak to improve performance of Windows XP

SHARE

58 COMMENTS

  1. Hi all,

    i am having problem one of my server, i cannot connect as a remote, this happen since yesterday, beofre yesterday it was fine working, usually i use vista machine and it was working more 3 years. this is the message “protocol error this session will disconnect try later” can some help me.

    many thanks

  2. This still doesn’t work. I have deleted the keys and followed the procedure through on two different systems both with the same emssage one it worked fine the other it didn’t . Both are running Windows XP pro and both have up to date SP’s.

  3. After the MSLicensing removal you must start mstsc as the administrator for the reconstruction of keys.

  4. Hi,

    I deleted the HardwareID and Store folder. However, only the HardwareID is created after I restart the system. I still have the same problem. Can you help? thanks.

    Ken

  5. @Ben – The easiest way to sort this problem is:
    1> Take a back up of your registry file. If you do not know how, please Google “How to take back up of Registry file”.
    2> When I said “Delete the MSLicensing Key”, I meant the whole folder itself, rather the complete key=value pair. Once you have deleted it, follow the instructions step by step, and that should easily solve your problem.

    If in case you still face problems, especially because of registry key, the you can overwrite the new registry setting with your old one, since you would have taken a backup.

    Cheers,

  6. I just wanted to make sure when you said “delete the MSLicensing key”, you meant the whole folder or just the registry file under MSLicensing? My problem is I could not delete that registry file under MSLicensing and I have 2 folders under MSLicensing, they are hardwareID & Store. I tried to delete the registry file only, but it said :unable to delete all specified values” Anyone got clue? Thanks in advance!

  7. Fire :
    In Windows 7 it’s really important that you start the remote desktop session after deleting the registry key “as Administrator”. If not, the registry key wouldn’t be created correctly.

    This was the key for me. Some posts above suggest running IE as adminstrator, but it is the “Remote Desktop Connection” program that needs to be run as Administrator in order for the registry keys to be created after deleting them.

  8. This all still begs the question of why doesn’t Microsoft fix this problem???
    It has been a problem since 2000. I have 125 servers in the fileld around 8000 workstations… and all have this problem. All the way to 2008R2. They say its a problem with the network but that can’t be true on all the networks??? Local, Remote, 1 server 1 workstation with cross over cable. The protocol is the problem. My customers are mad at me for this problem. What should I tell them? OY!!!!

    Microsoft needs to address this issue!

  9. Thanks! This fixed the error on my Vista Home Premium!

    I compared the old registry values to the recreated values and as far as I can see, only the ClientHWID value has changed. Could it be that the Terminal Server was restarted and in the process my laptop’s ID was lost? So logging remotely with an invalid ClientHWID will produce an error, but if the registry has no key for ClientHWID then it will be recreated propertly? BTW, Fred Schneider’s tip did not work for me (IE8).

    http://www.hardwareanalysis.com/content/topic/29453/
    http://support.microsoft.com/kb/2021885

    Keywords to search: ClientHWID, TS CAL

    Happy New Year y’all :)

  10. This is an odd error that seems to be croping up all over. I was having a major headache using RDP to log into a server in my forrest. Funny thing I did to fix this was when I opened IE to type the address to my remote login, I just ran IE as administrator. It worked without me editing the registry or anything else. Worked for both my Win7 and my Vista computers.

  11. Swapnil

    Easy fix – see post above.

    Here’s a recap of what you need to do:
    1. Run REGEDIT
    2. Locate HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing
    3. Delete the MSLicensing key
    a. Make sure this is the only thing selected.
    b. If in doubt, you can always export the key out to a file as a backup before deletion
    4. Re-run Remote Desktop Connection
    a. If running Windows 7 or Vista, you must right click on the Remote Desktop Connection shortcut and choose “Run as Administrator”
    b. Windows XP – simply run Remote Desktop Connection
    5. The software should regenerate the keys and you will see the login screen

  12. Hi, I hade the same problem: This solv my problem.
    Befor you do this make sure u have deleted supfolders to ” KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing”
    Start run and type MSTSC when you cee the remote desktop mangement wright click and Run as administrator.
    This worked for me.
    Regards,
    Hassan

  13. Hi,

    This is Swapnil. when i am trying to do remote connection I am getting following erro.

    The remote computer disconnected the session because of an error in the licensing protocol. Please try connecting to the remote computer again or contact your server administrator.

    Please if u can tell m the right solution.

    regards,

    swapnil

  14. I had the same RDP problem but on a Windows 7 machine.

    I right clicked on the RDP icon and selected Run as Administrator and it fixed the problem for all users on that PC.

    Thanks for the advice.

  15. In Windows 7 it’s really important that you start the remote desktop session after deleting the registry key “as Administrator”. If not, the registry key wouldn’t be created correctly.

  16. Thank you for this.
    I have the same problem but on a Windows 7 machine.
    Deleting the registry key removed that error message but I got another one which shows up: “The remote computer disconnected the session because of an error in the licensing protocol”

    All I had to do then is right click RDP and select “Run as Administrator” which then created that registry key that was removed.

  17. Thanks guys..copying MSLicensing registry key from a PC known to be working to the PC with the problemw saved the day.

  18. Using Windows 7: I bought a new notebook, the first time I tried to connect to remote desktop the error message came up. Followed advice from above [right-clicked Internet Explorer icon, and clicked “Run as administrator”]. Now connects fine. Thank you!

  19. please help me…. my one computer is remove from the server i can’t manage the time for it……how can i connect again to that computer.. please help….

  20. Hi, had this problem overnight on Windows 7, my user account is an admin but the recreation of keys wasn’t working. After reading the comments here I forced the run as admin option by right clicking, didn’t realise it was different from logging in as admin and running the program… This recreated the deleted reg keys and the access to my RDP sesssions was restored.

  21. Using Windows 7: your suggestions worked for me. I deleted the registry keys; rebooted the computer; right-clicked Internet Explorer icon, and clicked “Run as administator”. Thank you!

  22. Tried it on different clients. Win XP Prof. and Win 7 Prof. Always as an administrator. But it won’t work for me. :-(

  23. thanks for the post. it works fine for me. i renamed the licenses and tried reconnecting to my server it worked.
    regards
    arasssen

  24. @Paul

    Ah, you legend. Just what I was looking for. Was going crazy looking at all the possible server-side issues. This worked for me.

  25. @Compari: a Mac fix:

    I was getting this error using RDC on the Mac too, but a colleague found this article from Microsoft: http://support.microsoft.com/kb/187614

    The good stuff for Mac is about half-way down the article:

    “The RDP client for Macintosh stores the license in a file on the local computer in the folder hierarchy under /users/Shared/Microsoft/RDC Crucial Server Information/. To clean the Macintosh client’s license cache, delete the contents of this folder. The client will try to obtain a new license from the server the next time that it connects.”

    Just worked for me…Hope this helps some

  26. This works for Win7: The first time you try to connect to a RWW site, run Internet Explorer as Administrator (Right-click the IE icon, select Run as administrator). Now the registry settings are renewed.
    Note: You only need to this the first time.

  27. @Haydee – If you’ve followed all steps mentioned in the post, you should have a new MSLicensing key created when you restart your system.

    What exactly is the problem?

  28. I deleted my MSlicensing from my laptop computer in error…please help I have windows XP and have been trying to get this back, I need it for work…

  29. I am running MAC PRO and the server is Windows 2000. I am having the same error in Licensing protocol. Someone told me to delete the RDC files on my MAC and that would solve the problem. I don’t know where Microsoft RDC files are on the MAC. Can you help?
    please note all other Windows workstations do not get the licensing protocol error from the Server. Only my MAC does.

    Thanks

  30. Windows 7 is my system. Target system is windows 2008 server
    i tried from XP system also, but the same message..

  31. hi, am also facing similar problem. But after doin the above steps still getting same error. Actually we have hosted 2 server in data centre. and both we access thru remote desktop, while one server we were able to connect thru remote desktop, another server we getting that error.
    pls help

  32. I had tried right clicking but there is no option for “Run as administrator” when you are logged in as administrator. I did find a solution though. This is pirated from another website. He said there are 3 solutions. It took the second one for me and I went ahead and changed the permissions too.

    1) Right click the icon and click “Run as Administrator”
    2) In the search menu on the Start menu type “mstsc” (no quotes) and then instead of hitting Enter press Ctrl+Shift+Enter to run mstsc.exe (Remote Desktop) as an administrator.
    3) The less-hassel way it to open regedit, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing, and right-click and change the permissions so all users have full control of that key.

  33. Chass, though you’ve logged in as administrator you need to manually run each command as an administrator. While creating the license keys right click and you’ll find the option run as administrator and this will create the licensing keys. If the problem still persists, let me know so that I can send the exact procedure.

    Best

  34. I’m running Vista Home trying to fix the same problem with a users computer. I’m logged on as an administrator. I’ve deleted the keys inside of MsLicensing and rebooted. I get the same error message as before. It did not recreate the licensing keys. So I exported them from an XP machine but it won’t import the keys. I don’t have any other Vista machines in the building to export the key from. Any suggestions?

    Chass

  35. @Matt – Did you try running it as the administrator ? While running, right click and select the option ‘Run as adminimstrator’. That should help if you are on Vista. If you still have problems let me know.

  36. Got same problem. Removed MSLicensing key, did not recreate itself. Imported from a working PC – didn’t work either.

    Running Vista SP2.

  37. I removed the key because of an error that the licensing could not be renewed. Then I got this error “Licencing protocol error”. Now there is no key in the registry to delete. Do you have any further help?

  38. the deleting of the registry key/subkeys did not work so I copied the MSLicensing registry key from my computer to the one that was having a problem, that solution worked for me as well.

  39. @ Softwaresnhard – I don’t see a reason why this would not work :( .. may be there are situations when it doesn’t. Thanks for informing.

  40. Hi, I tried this method before and it didnot work out for me, at last i end up copying the MSLicensing registry key from another system and imported it, it worked…

  41. […] But my client was getting a generic error : “You were disconnected from the Windows-based computer because of problems during the licensing protocol”. We’ve already discussed one of the regular problem: “The Remote Computer Disconnected the session because of an error in the Licensing protocol“. […]

LEAVE A REPLY