I was running into this same problem for the past week with Microsoft Remote Desktop Version 10.2.1 (1143) for Mac, and I may have just solved it. This does not help if you are stuck already and do not have access at all, but once you do have access, configuring this should prevent the problem in the future. The solution I used is to enable keepalives for remote desktop connections:
- If you can manage the remote machine through group policy, follow the instructions posted here:
http://jbcomp.com/keeping-remote-desktop-connections-alive/
Otherwise keep reading.
- Open the registry editor (just search for it-- win-S, "regedit").
- In the tree view, navigate to HKEY_Local_Machine -> SOFTWARE -> Policies -> Microsoft -> Windows NT -> Terminal Services
- In the pane on the right-- right-click, New -> DWORD (32-bit) Value
- Name it "KeepAliveEnable", then double click it and enter a value of 1
- Repeat steps 4 and 5 with the name "KeepAliveInterval"
- Close the registry editor.
- To be sure the setting will be used, reboot the machine, or restart Remote Desktop Services from the Services management console (Win-S, "Services").
That's it. So far this has prevented the issues I was having multiple times a day with receiving the 0x4 error on attempting an RDP connection. As usual with Microsoft products, YMMV.