Server 2012 R2 RDS sessions keep disconnecting

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
-------------------------
LVL 1
cdblindAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Zacharia KurianAdministrator- Data Center & NetworkCommented:
Have a look at the attached and try changing the session settings.

collection
session
0
cdblindAuthor Commented:
Hi Zacharia

Session setting are set at:
      End disconnected session: 3 hrs
      Active session limit: 12 hrs
     Idle session limit: 1 hrs
0
Zacharia KurianAdministrator- Data Center & NetworkCommented:
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
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

cdblindAuthor Commented:
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
Zacharia KurianAdministrator- Data Center & NetworkCommented:
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
cdblindAuthor Commented:
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
Zacharia KurianAdministrator- Data Center & NetworkCommented:
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
cdblindAuthor Commented:
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
Zacharia KurianAdministrator- Data Center & NetworkCommented:
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
cdblindAuthor Commented:
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
Zacharia KurianAdministrator- Data Center & NetworkCommented:
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
cdblindAuthor Commented:
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
cdblindAuthor Commented:
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
Zacharia KurianAdministrator- Data Center & NetworkCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cdblindAuthor Commented:
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
George SimosIT Pro Consultant - IT Systems AdministratorCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2012

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.