Windows 10 Remote Desktop Session Randomly Unexpectedly Terminates

9,560

Solution 1

I believe this issue has been fixed in Windows 10 build 19018 (20H1), which is available to Windows Insiders. You should be able to get this if you're willing to switch to the Slow ring in your Windows Insider Settings.

I've been experiencing it as well and it seems to have gone away after upgrading.

Solution 2

I faced the same issue. The solution eluded me until I noticed the clock was off. I update the time server and still had problems until I restarted the server.

Solution 3

This link shows that it is possibly group policy updates although the solution provided does not always work.

Although this might work for you:

The best workaround I found is to increase the interval between group policy refreshes. I set it to 8 hours (480 minutes) for domain controllers and now I get at most one RDP reset a day.

Quoted from this page.

EDIT:

It could possibly be this:

Or Most probably you have switched on "Dynamic lock". This detects if you are using the computer or not and locks it if you seem to be away.

You can find this at: Settings (Windws+i) -> Accounts -> Sign-in options -> Dynamic lock

Qouted from this page.

Try doing Win+R and mstsc.exe /admin and staying logged on like this. Then see if it shows a "Logging off..." message when the error happens.

Share:
9,560

Related videos on Youtube

Mister Cook
Author by

Mister Cook

Updated on September 18, 2022

Comments

  • Mister Cook
    Mister Cook over 1 year

    I remote desktop to my Window 10 Surface laptop via LAN (to use Outlook from the laptop) allowing me to create send/emails on the Surface laptop via remote desktop from my desktop PC. This has been working fine for 2+ years. Recently the Surface 10 has started ending the remote desktop session randomly perhaps 2 or 3 timeS per day. The worst parts is that it also terminates all running applications so when I can finally remote desktop back in my Outlook sessions have been lost. This is frustrating as I have lost a lot of drafted emails. (I’ve setup Outlook to save every 1 minute but still I want to fix this).

    If I try to immediately log back in via RDP I sometimes get:

    The number of connections to this computer is limited and all connections are in use right now. Try connecting later or contact your system administrator.
    

    I wait and try again and I can log back in but all my applications have been terminated. Perhaps the user session is being logged out and back in – I can’t tell.

    There are no failed attempts in System Event Log Security, only forced log off. I noticed over 100 Audit Success security events at same time:

    Credential Manager credentials were read.
    Subject:
        Security ID:        DOMAIN\My Name
        Account Name:       My Name
        Account Domain:     DOMAIN
        Logon ID:           0x1A293A3D8
        Read Operation:     Enumerate Credentials
    This event occurs when a user performs a read operation on stored credentials in Credential Manager.
    

    This is then followed with:

    An account was logged off.
    Logon Type:         3
    
    This event is generated when a logon session is destroyed. 
    It may be positively correlated with a logon event using the Logon ID value. 
    Logon IDs are only unique between reboots on the same computer.
    

    Windows System Events at arounds this time shows a number of Errors:

    The server {AAC1009F-AB33-48F9-9A21-7F5B88426A2E} did not register with DCOM within the required timeout.
    The system is exiting connected standby 
    
    Reason: Input Keyboard.
    A timeout was reached (30000 milliseconds) while waiting for the Sync Host_1a14de225 service to connect.
    A timeout was reached (30000 milliseconds) while waiting for the Windows Push 
    
    Notifications User Service_1a14de225 service to connect.
    The Clipboard User Service_1a14de225 service failed to start due to the following error: 
    The service did not respond to the start or control request in a timely fashion.
    A timeout was reached (30000 milliseconds) while waiting for the Clipboard User Service_1a14de225 service to connect.
    
    The Connected Devices Platform User Service_1a14de225 service failed to start due to the following error: 
    The service did not respond to the start or control request in a timely fashion.
    A timeout was reached (30000 milliseconds) while waiting for the Connected Devices Platform User Service_1a14de225 service to connect.
    
    The Clipboard User Service_1a14de225 service terminated unexpectedly. 
    It has done this 1 time(s). 
    The following corrective action will be taken in 3000 milliseconds: 
    Restart the service.
    
    The Sync Host_1a14de225 service terminated unexpectedly. 
    It has done this 1 time(s).
    The following corrective action will be taken in 10000 milliseconds: 
    Restart the service.
    
    The Windows Push Notifications User Service_1a14de225 service terminated unexpectedly.
    It has done this 1 time(s).
    The following corrective action will be taken in 10000 milliseconds:
    Restart the service.
    
    • harrymc
      harrymc over 4 years
      This post suggests that RDP is disconnected upon periodic Group Policy updates. The suggested fix is to set under registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server the value of fDenyTSConnections to zero. I checked, and this entry still exists on Windows 10.
    • Mister Cook
      Mister Cook over 4 years
      Thank you for suggestion, however, fDenyTSConnections is already set to zero on the system being connected to.
    • harrymc
      harrymc over 4 years
      Have you checked group policies under Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Session Time Limits? Is it possible that two persons are using the same login and one is kicking the other out?
    • Albin
      Albin over 4 years
      Technically it's not the remote session (connection) that terminates and causes the apps to close. The user session terminates (regardless if the user used RDP or logged in directly) which means the user gets logged off which then terminates all open applications started by that user. Did you set some kind of timeout or anything (e.g. to terminate the user session if the remote connection stays disconnected for a certain amount of time)? Did the termination take place while you were logged on remotely / actively doing s.th. or was the system idle and/or not connected via a remote connection?
    • Albin
      Albin over 4 years
      Also: do you log an as an administrator? if not, does the problem still occur when you log on as admin?
    • Mister Cook
      Mister Cook over 4 years
      The termination takes place whilst I am logged in via a remote connection and active, e.g. I am editing an email via remote desktop and then I am terminated from the remote session and then the Windows session on the laptop is lost and my emails gone too. I have not seen this happen when working directly with the laptop (i.e. it only seems to occur when using remote desktop)
    • Mister Cook
      Mister Cook over 4 years
      I am logged in as admin and the problem occurs in this case.
    • Mister Cook
      Mister Cook over 4 years
      No Session Time Limits are configured and there is no 2nd person logging in.
    • Mister Cook
      Mister Cook over 4 years
      Sadly this problem still persists daily and currently no solution has been found - all suggestions to date have been tested but none have worked so far.
    • Vomit IT - Chunky Mess Style
      Vomit IT - Chunky Mess Style over 4 years
      From admin elevated command prompt, run sfc /scannow, let that run, reboot and see if the problem continues. Also, ensure that the latest Windows Updates are installed and check for firmware updates from the machine manufacturer website and update that as well including BIOS/CMOS updates. To be extra thorough, consider running chkdsk C: /F /R /X, and then reboot.
    • Mister Cook
      Mister Cook over 4 years
      The described problem remains. The system is clean and up-to-date no issues with Windows Updates/Firmware, BIOS, etc. No idea where to go now?
    • Vomit IT - Chunky Mess Style
      Vomit IT - Chunky Mess Style over 4 years
      @MisterCook .... Okay, then I think perhaps the issue is with your settings that tell Windows how long to allow a disconnected session stay active before logging the Windows session off. While you may not be able to prevent whatever is causing the time out issue to begin with, you should be able to tell Windows to not ever log off any RDP disconnected sessions. From HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services create a REG_DWORD with a value of 0 and then reboot the machine. Now RDP in and wait to see if you get logged off when the on the next disconnection occurs.
    • Vomit IT - Chunky Mess Style
      Vomit IT - Chunky Mess Style over 4 years
      @MisterCook See Set time limit for disconnected sessions for more detail of these settings. If you confirm this helps you solve the problem, I'd like to write it up on an answer for you to accept so just let me know. I looked over the other answers and I don't see this being anything anyone suggested so I'll be happy to write an answer with more detail if it helps since I mentioned this and it's the "worst part" as you mentioned that I'd like to help you resolve.
    • Mister Cook
      Mister Cook over 4 years
      @Pimp Juice IT - thank you for suggestion, I added MaxDisconnectionTime as DWORD 0 and applied. It will take a couple of days to see if this has had any effect because "on a good day" the problem only occurs once per day.
    • Mister Cook
      Mister Cook over 4 years
      Sadly the problem remains with MaxDisconnectionTime set to 0
    • Vomit IT - Chunky Mess Style
      Vomit IT - Chunky Mess Style over 4 years
      @MisterCook You never tagged me back by my handle name so just seeing this.... From PowerShell elevated command prompt, run the PowerShell logic I saved here pastebin.com/99Q0aUnJ that is related to changing the four key values there which you can see more detail on at docs.microsoft.com/en-us/openspecs/windows_protocols/ms-tsts‌​/…. Perhaps you need to set these to those values, reboot, and then see what happens. I'm still interested in writing up an answer so tag me back when you get to and have an update on that suggested possible solution.
    • Mister Cook
      Mister Cook over 4 years
      @PimpJuiceIT - thanks for the suggestion - I've applied those changes and will let you know if this fixes (problem normally occurs only 1-2 per day)
    • Mister Cook
      Mister Cook over 4 years
      @PimpJuiceIT - unfortunately the issue still remains with those further changes.
  • Mister Cook
    Mister Cook over 4 years
    Thanks for suggestion. I changed the group policy refresh rate to a very regular 1 minute (down from the default 90 mins) to see if this would reproduce the issue so that I could be sure this was the cause. This change has not impacted the frequency of the problems so it is not clear this is related.
  • DDiamond
    DDiamond over 4 years
    Please see my new edit if this possibly solves your problem.
  • Mister Cook
    Mister Cook over 4 years
    Thanks again but Windows Dynamic Lock is not on.
  • Mister Cook
    Mister Cook over 4 years
    Connecting with mstsc.exe /admin to see if there is any difference
  • Mister Cook
    Mister Cook over 4 years
    Problem persists with connecting with mstsc.exe /admin
  • Mister Cook
    Mister Cook over 4 years
    Thank you for suggestion but these changes made no difference. The problem persists and causes data loss daily.
  • harrymc
    harrymc over 4 years
    Did you try making them on both the computer and the Surface?
  • Mister Cook
    Mister Cook over 4 years
    Previously only tried on Surface but have applied changes to both PCs and will report back if this resolves it.
  • Mister Cook
    Mister Cook over 4 years
    I tried the settings on both PCs and unfortunately problem remains with daily random disconnection and all apps terminated.
  • harrymc
    harrymc over 4 years
    Strange. This should have worked. Is it possible that the problem is inbetween?
  • Mister Cook
    Mister Cook over 4 years
    By "inbetween" - do you mean network issues? I don't see any other network issues. Also, I do connect to other devices on the network with Remote Desktop in the same way without seeing this problem (although the Surface RDP sessions are more frequent and much longer in duration but I've not seen this elsewhere ).
  • Mister Cook
    Mister Cook over 4 years
    Sadly the problem remains.
  • Mister Cook
    Mister Cook over 4 years
    This sounds promising but I could not find any mention of a fix for this issue in the "What's new" documentation. Is there any documentation of a related fix anywhere? Also, did you have to upgrade both PCs (i.e. the client and server or just one)?
  • Chris P.
    Chris P. over 4 years
    The page above lists "includes the fix for the issue resulting in black screens and disconnects over remote desktop in the last couple of flights" and feedback I submitted via the Feedback Hub was resolved. You only need to upgrade the host, not the guest.
  • Mister Cook
    Mister Cook about 4 years
    Thanks for suggestion - however on my systems all clocks are correct and in sync so still seeing the issue.
  • Community
    Community over 2 years
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
  • Dave M
    Dave M over 2 years
    This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review