While trying to connect to your Terminal server, you are receiving a "The remote computer has ended the connection" error, to fix it:

1. Download and install devcon.exe from Microsoft. It’s a command line device manager tool.

2. Run devcon.exe which will extract it.

3. Open the Command Prompt

4. Navigate to the extracted devcon folder.

5. Type  devcon.exe -r install %windir%\inf\machine.inf root\rdpdr

6. Wait until it completes.

7. That’s it, try to connect remotely again.