Sometimes you can not establish the RDP connection to a server or to a workstation right after restart. It is pingable, the remote connection is allowed, local logon works perfectly, but RPD connection does not work. What could happen?Pretty often the reason is hidden in the corrupted IPSec policy. If you have uninstalled any software that could work with or through IPSec, such as VPN client, firewall, security agent, etc, this could be the reason.
In this article Microsoft shows how to fix the problem. Long story short, this is what you need to do:
1. Delete the local IPsec policy. To do this, delete the following registry key with all its subkeys:
2. Rebuild a new local policy store by running the following command:
3. Verify that the IPsec service is set to automatic, and restart the computer