Solved

Server 2012 R2 RDS sessions keep disconnecting

Posted on 2014-10-14
16
9,477 Views
1 Endorsement
Last Modified: 2016-05-16
Hi
I have setup a 2012 R2 server with Remote Desktop Services (Sessions) using the quick setup. It only has one client that logs in each day for about 8 hours. But he gets randomly disconnected from the RDS session. Sometime a session will last an hour and sometimes only a couple of minutes. There is not a lot of info in the event logs the only thing I can find is in the "Microsoft-Windows-TerminalServices-LocalSessionManager/Operational' event log. It comes up with an Event ID 40 with reason code 0 and sometimes with reason code 5 but not all the time.

Does anyone know what is causing it, and how to fix? Have just changed the GPO for the 'Keep alive' to one minute to see if that fixes it, as it was previously off.

The Evens:

- System

  - Provider

   [ Name]  Microsoft-Windows-TerminalServices-LocalSessionManager
   [ Guid]  {5D896912-022D-40AA-A3A8-4FA5515C76D7}
 
   EventID 40
 
   Version 0
 
   Level 4
 
   Task 0
 
   Opcode 0
 
- System

  - Provider

   [ Name]  Microsoft-Windows-TerminalServices-LocalSessionManager
   [ Guid]  {5D896912-022D-40AA-A3A8-4FA5515C76D7}
 
   EventID 40
 
   Version 0
 
   Level 4
 
   Task 0
 
   Opcode 0
 
   Keywords 0x1000000000000000
 
  - TimeCreated

   [ SystemTime]  2014-10-15T06:00:51.051828700Z
 
   EventRecordID 1812
 
  - Correlation

   [ ActivityID]  {F4207BE2-304E-469D-9D5A-B2C3C19F0000}
 
  - Execution

   [ ProcessID]  704
   [ ThreadID]  6452
 
   Channel Microsoft-Windows-TerminalServices-LocalSessionManager/Operational
 
   Computer xxxxx.xxxx.local
 
  - Security

   [ UserID]  S-1-5-18
 

- UserData

  - EventXML

   Session 4
 
   Reason 0
 
 
   
-------------------------
Keywords 0x1000000000000000
 
  - TimeCreated

   [ SystemTime]  2014-10-15T06:00:51.220859900Z
 
   EventRecordID 1813
 
  - Correlation

   [ ActivityID]  {F420A109-0041-4385-A069-1136A3B60000}
 
  - Execution

   [ ProcessID]  704
   [ ThreadID]  6452
 
   Channel Microsoft-Windows-TerminalServices-LocalSessionManager/Operational
 
   Computer xxxx.xxxx.local
 
  - Security

   [ UserID]  S-1-5-18
 

- UserData

  - EventXML

   Session 2
 
   Reason 5
-------------------------
1
Comment
Question by:cdblind
  • 8
  • 7
16 Comments
 
LVL 9

Expert Comment

by:Zacharia Kurian
ID: 40381541
Have a look at the attached and try changing the session settings.

collection
session
0
 
LVL 1

Author Comment

by:cdblind
ID: 40381586
Hi Zacharia

Session setting are set at:
      End disconnected session: 3 hrs
      Active session limit: 12 hrs
     Idle session limit: 1 hrs
0
 
LVL 9

Expert Comment

by:Zacharia Kurian
ID: 40381649
Idle session limit: 1 hrs

If the user's idle session reaches 1 hour, yes he will get disconnected. Does he get disconnected before the  set idle session time range?

What was the purpose of enabling RDS for the user?  I mean, does he uses any applications in the RDS server or connect to any other applications through RDS server?

Just go through the below link for some helpful tips.

http://msfreaks.wordpress.com/2013/12/09/windows-2012-r2-remote-desktop-services-part-1/
0
 
LVL 1

Author Comment

by:cdblind
ID: 40381894
The user works from home, logs in via VPN. Yes he gets disconnected before the hour sometimes less then a minute after login, sometimes 45 minutes or an hour, his desktop is not idle for more than five minutes. If his desktop is idle for a hour the he is not working is he.
0
 
LVL 9

Expert Comment

by:Zacharia Kurian
ID: 40382041
End disconnected session: 3 hrs
      Active session limit: 12 hrs
     Idle session limit: 1 hrs


Ok. For a test purpose can you make the all the 3 session settings to be "never" and see the performance?
0
 
LVL 1

Author Comment

by:cdblind
ID: 40383355
Hi Zacharia

Have made the suggested changes and the has not fixed the problem. I am having a tech look at the issue from the other end today to see if that is the problem.

Any other ideas?

Your help is appreciated.
0
 
LVL 9

Expert Comment

by:Zacharia Kurian
ID: 40383645
Please check the RD license in your server. To check it out, from power shell execute
"Get-RDLicenseConfiguraation"  (with out quotes)

Let us know if you have license or not.
0
 
LVL 1

Author Comment

by:cdblind
ID: 40383656
Hi Zacharia
Below is the out put of Get License, I am a bit surprised of the out put as I when I use RDS with local clients its fine. And the license server, and session broker say they are setup in server manager.  

Windows PowerShell
Copyright (C) 2013 Microsoft Corporation. All rights reserved.

PS C:\Users\xxxxxxx> Get-RDLicenseConfiguration
Get-RDLicenseConfiguration : A Remote Desktop Services deployment does not exist on xxxx.xxxx.local. This
operation can be performed after creating a deployment. For information about creating a deployment, run "Get-Help
New-RDVirtualDesktopDeployment" or "Get-Help New-RDSessionDeployment".
At line:1 char:1
+ Get-RDLicenseConfiguration
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-RDLicenseConfiguration
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 9

Expert Comment

by:Zacharia Kurian
ID: 40383693
sorry you have run it on the connection broker server.

But any way from your RDS server itself, you can find the licensing as per the below snapshot.
LIC RDS
0
 
LVL 1

Author Comment

by:cdblind
ID: 40383703
Licensing server and session broker are on the same server, as per the quick setup install. As per your picture above mine looks the same.

When I go to licensing server manager the licensing server shows up as activated.  When I review the configuration under licensing manager everything is green. Scope is domain.
0
 
LVL 9

Expert Comment

by:Zacharia Kurian
ID: 40383821
Now my doubt would be the VPN or the home internet connection of the user.

Have you  checked the VPN logs? If not check it out and see if the connection drops or not.

Is there a way that you can VPN & connect to the server from some where else, where you have a faster internet?
0
 
LVL 1

Author Comment

by:cdblind
ID: 40387815
Hi Zacharia
Have tested the VPN both ends and client internet everything is ok, no issues with VPN or internet connection. Client side has consistent 100/40Mbps, and our side is the same, not connection dropouts.

Looking into  the log I have found these entries in the 'RemoteDesktopServices-RdpCoreTS/Operational' log and they are consistent with the times the client gets disconnected.

"The network characteristics detection function has been disabled because of Reason Code: 2(Server Configuration).."

I am not sure what they mean but they seem to happen at the same time I get the disconnections, with event log entry:

Event ID: 24 "Remote Desktop Services: Session has been disconnected:"
Event ID: 40 "Session X has been disconnected, reason code 0"

I have been unable to find anywhere a list of the disconnection reason codes, this is so frustrating. I assume they out put a code for a reason.
0
 
LVL 1

Author Comment

by:cdblind
ID: 40391413
Hi
I have been unable to resolve the issue, I have deleted and reinstall the OS from scratch twice and each time have the same issue. I have since stopped using server 2012 R2 and gone back to server 2008 R2 which works no problems.

The server 2012 RDS session randomly disconnect when accessed from the internet via VPN or directly, and the sessions will not last more than an hour, but sometimes less than a minute but this usually only happened on auto reconnect.

The 2012 R2 system was the 180 trial, and had only been running  a week. I check the RDS licensing grace period with power shell and there were not issue. I am completely stumped as to why the issue only shows when connecting from the internet and not the local network. Other than Event log information about disconnections reason code "0" which I have been unable to find any information on there are no warnings or error in the event log that would explain the disconnects.

My only conclusion is there is either a setting that I am not  a where of, or Microsoft has deemed any access from the internet to be production and put a time limit on it.

If someone eventually find a reason or solution to this please post here, I would like to know. But for now I have given up on 2012 R2
0
 
LVL 9

Accepted Solution

by:
Zacharia Kurian earned 500 total points
ID: 40391696
The 2012 R2 system was the 180 trial

You should have mentioned that you were running on a trial version!.

I too had issues with the trial 1st, but when when licensed, did not face any issues.
0
 
LVL 1

Author Comment

by:cdblind
ID: 40393568
ok sorry about that

So it is a limitation of the trial version. Microsoft state their are no limitation on the trial version, this is so frustrating. I wasted so much of my time on it and yours, trying to track down the problem.

Sorry.
0
 
LVL 7

Expert Comment

by:George Simos
ID: 41597315
Although this thread is old and solved I would like to chime in and state that the RDS always had 120 days of trial period.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now