HyperV and the fight between local and group policies. (Random RDP disconnects no more!)

This is probably the simplest solution to a confoundingly hard to pinpoint problem yet. We had some HyperV virtual machines that are managed via RDP (which is very common). For some reason the sessions would disconnect at random seeming intervals. Sometimes almost immediately, sometimes after fifteen minutes or even longer.

Many searches of the Internet and Microsoft documentation came up with nothing of real value until we stumbled across the registry key HKLM\System\CurrentControlSet\Control\Terminal\fDenyTSConnections which was set to 1.

This was odd, as the group policy for the domain enabled RDP as we use it widely across the servers for management. It turns out that this setting was being set by group policy and then reset to 0 and then set by group policy and reset... over and over again.

Setting this key locally ended the RDP disconnects. I have no idea why the group policy wasn't being obeyed, but this is now the first place I look (although it would seem you wouldn't be able to connect in the first place if this was the problem).

At least the workaround is simple.