About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
After a Remote Desktop client loses its connection, it cannot reconnect straight away, and the user gets a security error message. When the client does reconnect, the Remote Desktop Session Host (RDSH) server puts it in a new session instead of the original one, and the original session still shows as active on the server instead of disconnected. Microsoft documents two workarounds: enable the "Configure keep-alive connection interval" policy, or reconfigure the security layer and encryption settings.
Before you change anything, find out whether users have an unsaved old session, record the current settings, and warn users. Ending an old session without warning can lose the work in it.
What the error means
Microsoft's page gives two messages: "The client couldn't connect to the terminal server because of a security error. Make sure you are signed in to the network, then try connecting again." and "Remote Desktop disconnected. Because of a security error, the client could not connect to the remote computer. Verify that you are logged onto the network and then try connecting again."
Microsoft's description of the behaviour is: "When the Remote Desktop client reconnects, the RDSH server reconnects the client to a new session instead of the original session. However, when you check the RDSH server, it says that the original session is still active and didn't enter a disconnected state."
The original session, with whatever the user had open in it, is therefore not the one the client lands in, and a second session starts. Microsoft's page does not explain why the server still treats the old session as active. It gives two workarounds, covered below, and applies to "Supported versions of Windows Server".
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| The old session still shows as Active on the server after the client has gone (Microsoft gives no reason) | Old session listed as active; new session on reconnect | query session shows two sessions for the same user, one of them active but unused |
| Security layer or encryption level mismatch between client and server | The security error messages above | Security layer and Encryption level on the RDP connection properties |
| FIPS-compliant encryption policy overriding the connection setting | Connection settings look right but behaviour differs | Microsoft's page says the "System cryptography: Use FIPS compliant algorithms" policy overrides the encryption level policy |
| Check: certificate has a private key | Microsoft's page gives a check that the certificate has a private key; it does not say a missing key causes the error | RD Session Host Configuration, certificate view shows "You have a private key that corresponds to this certificate" |
Prove the cause before changing anything
All of these read only. On the RDSH server, list the sessions:
query session
The query session page says the command "Displays information about sessions on a Remote Desktop Session Host server", including the session name, user name, ID and state. Reproduce the problem with one test user, then run it again and look for the same user with two sessions, one of them in the active state while that user's client is disconnected.
To see whether Group Policy already sets these values, produce a report. Create C:\Temp first if it does not exist:
gpresult /scope computer /h C:\Temp\rdsh-policy.html
Open the report and look under the Remote Desktop Session Host policy folders for "Configure keep-alive connection interval" (under Connections) and for the Security folder settings. Record whether each is Enabled, Disabled or Not configured, and the interval if one is set.
In RD Session Host Configuration, open the connection's properties and note the current Security layer and Encryption level, and check the certificate view for the private-key line.
Example (illustrative): at contoso.com.au, staff on a train lose their connection to rds01 and, on reconnecting, find an empty desktop. query session on rds01 shows the user jsmith with session ID 4 still active and session ID 7 newly created. The keep-alive policy is Not configured. The old session still showing Active is the symptom Microsoft describes, and with the keep-alive policy Not configured, Microsoft's first workaround applies.
Fix
Step 1: tell the user, and save their work if you can. The old session may still hold their documents.
Step 2 (if an old session needs to be removed): reset it. The reset session page says to reset "only when it malfunctions or appears to have stopped responding" and warns that "resetting a user's session without warning the user can result in the loss of data at the session."
Disruptive step: resetting deletes the session and everything open in it. There is no way back for unsaved work. Run query session first and note the session ID of the old one, since resetting the wrong ID ends someone else's work.
reset session 4 /server:rds01
Microsoft's example form is reset session 3, and /server is needed only from a remote server.
Step 3: enable the keep-alive policy.
Save the GPO first (create C:\Temp and C:\GpoBackups if they do not exist), and keep the Id from the Backup-GPO output:
Backup-GPO -Name "RDSH-Settings" -Path C:\GpoBackups -Comment "Before keep-alive change"
Disruptive step: the keep-alive policy below applies to every RDSH server the GPO reaches and changes the interval at which they check session state. Apply the policy first to one test server.
Microsoft's workaround: "enable the Configure keep-alive connection interval policy" in Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Connections. "If you enable this policy, you must enter a keep-alive interval. The keep-alive interval determines how often, in minutes, the server checks the session state." Microsoft's page gives no recommended interval, so choose one and test.
To undo it, restore the saved backup:
Restore-GPO -BackupId BackupIdGuid -Path C:\GpoBackups
Use the saved Id in place of BackupIdGuid, then run gpupdate /force on the servers. The Restore-GPO page says -BackupId restores "a specific backup".
Step 4: if that is not enough, check authentication and configuration settings. Microsoft's page says this "can also be fixed by reconfiguring your authentication and configuration settings", at the server level or by GPO under Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Security.
Save first: write down the existing Security layer and Encryption level before you touch them.
Disruptive step: changing the encryption level below affects every user's next sign-in. Microsoft's page says "When you change the encryption level, the new encryption level takes effect the next time a user signs in." Clients that do not support the level you choose may be unable to connect.
At the server level: in RD Session Host Configuration, open the connection's properties, and on the General tab choose a Security layer. Under Encryption level choose from Low, Client Compatible, High or FIPS Compliant.
Microsoft's page names the choices but does not say which Security layer or Encryption level to select, so it gives no value to set. Pick a level your oldest client supports, with the owner of security, and test it with one user. To undo it, set the Security layer and Encryption level back to the values you wrote down; if the change was made through the GPO, restore the saved GPO backup with Restore-GPO.
Microsoft's page also notes that settings configured in Group Policy "override the settings you configured using the Remote Desktop Services Configuration tool", and that the FIPS policy overrides "Set client connection encryption level". Check the policy before concluding that a change in the tool has no effect.
To check the certificate, Microsoft's page says to go to Remote Desktop Services Configuration, right-click the connection, select General, then Edit, then View certificate. On the General tab you should see "You have a private key that corresponds to this certificate" if there is a key. Microsoft's page adds that the Certificates snap-in shows the same information. Microsoft's page does not say what to do if the line is missing. Replacing a certificate is a separate change with its own risk, so record the current certificate first and raise it with whoever owns it.
Microsoft's page also says: "When communications between clients and RD Session Host servers require the highest level of encryption, use FIPS-compliant encryption." Any move to FIPS Compliant is a policy decision for whoever owns security, not a quick fix for dropped sessions.
Microsoft describes the levels this way: High uses "strong 128-bit encryption", Client Compatible uses "the maximum key strength supported by the client", and Low uses "56-bit encryption" for data sent from the client to the server.
Confirm the fix
- Reproduce with the test user: drop the connection, reconnect, and confirm the client returns to the original session.
query sessionshows one session for that user, in a disconnected state while the client is away, and not two.gpresultshows the policy as Enabled with your interval, if you used it.
What to watch afterwards
- The number of sessions per user on each RDSH server. A user with two is the symptom returning.
- Users on mobile or train networks, whose connections you can compare with the session list.
- Certificate renewals. Microsoft's page describes how to check that the certificate has a private key; it does not say a missing key causes this problem, so check after a certificate is replaced.
- A new GPO that changes the FIPS or encryption policy.
Read next
Related articles you may want next.
- TroubleshootingRemote Desktop: "Remote Desktop Service is currently busy" when connectingRDP fails with 'Remote Desktop Service is currently busy'. Test the console, find memory and session leaks, check Group Policy and collect data.Read article
- Troubleshooting"Remote Desktop can't connect to the remote computer": work from the listener outwardsRemote Desktop says it can't connect for one of three reasons and gives no clue which. Check the server is running, prove the RDP listener is up, test the network path and port, then check what else is on port 3389.Read article
- Troubleshooting'The User Profile Service failed the logon' and event 1511 temporary profiles on Remote Desktop hostsUser Profile Service failed the logon or a temporary profile on a Remote Desktop host? Read events 1511, 1500, 1509 and ProfileList, then fix the cause.Read article
Risks and limits
These commands have not been run or lab-tested.
Microsoft's page does not say what causes the server to keep the old session active, and it does not say that either workaround is certain. It offers no recommended keep-alive interval. The security settings can stop clients from connecting if the level is higher than a client can use, so test with a client of each kind you have.
Sources
- Remote Desktop client disconnects and can't reconnect to the same session — Microsoft Learn, page dated 2026-02-12, accessed 20 November 2026
- query session — Microsoft Learn, page dated 2024-11-01, accessed 20 November 2026
- reset session — Microsoft Learn, page dated 2024-11-01, accessed 20 November 2026
- gpresult — Microsoft Learn, page dated 2024-11-01, accessed 20 November 2026
- gpupdate — Microsoft Learn, page dated 2023-02-03, accessed 20 November 2026
- Backup-GPO — Microsoft Learn, date not shown, accessed 20 November 2026
- Restore-GPO — Microsoft Learn, date not shown, accessed 20 November 2026
This article was originally published on .