RDS 2012 R2 random disconnects

We are testing out Windows Server 2012 R2 RDS. We have several users on the server but they are getting kicked out randomly. We've checked the network and don't see anything out of the ordinary. We have several 2008 R2 servers that are not having this issue.

when we look in the logs we see this:

Session 10 has been disconnected, reason code 12

Session 13 has been disconnected, reason code 0

The codes are different but the Event Id is the same, Microsoft-Windows-TerminalServices-LocalSessionManager Event ID 40.

Looking online i don't see a solid answer. I'm hoping someone has seen this before. One thing we did do, was put in a license for the server itself. We saw one post where someone was using the 180 day free trial (that's what we are using) and once they licensed it, it worked. We tried that but we are getting disconnects still.

Thank you.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Robin CMSenior Security and Infrastructure EngineerCommented:
To save my fingers, here's another question where I've posted a LOAD of stuff to check for.
Try those things in order and see if that helps, and report back on what works/does not work.
bbaoIT ConsultantCommented:
Event ID 40 is for RD licensing therefore the disconnection should be caused by a kind of licensing issue.

> where someone was using the 180 day free trial (that's what we are using)
> We tried that but we are getting disconnects still.

could you please clarify, do you mean you have tried using genuine license instead of the 180-day trial one?
msidnamAuthor Commented:
Yes, that is correct. We put in a valid windows 2012 R2 Standard key to see if it would help but it didn't.
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

msidnamAuthor Commented:
I've put in a ticket with Microsoft. So far they've sent me options that I've already found and didn't work. Currently they are having us run netmon on both client and servers to see what happens when the disconnect happens.
Robin CMSenior Security and Infrastructure EngineerCommented:
Will be interesting to know what they find - this seems to be a not-uncommon issue. Please keep us up to date with any new info/progress :-) You might even get some points for closing that other question I've been doing battle with for so long!!
msidnamAuthor Commented:
I will definitely keep you all updated.
msidnamAuthor Commented:
Microsoft escalated this to the network team. We ran packet captures between the clients and workstations. I gave the captures  to Microsoft and they said they see an ack reset coming from the server but they don't know why. No packet loss Or packets dropped and the communication looks clean they said.
Robin CMSenior Security and Infrastructure EngineerCommented:
Interesting... well at least it is coming from a device running their own code!
I'll be interested to know what the root cause of this is - hope they find it soon for you :-)
msidnamAuthor Commented:
I missed their call this morning but we have a scheduled call at 2pm EST. Hopefully they have something for me.
AaronSSHIT ConsultantCommented:
Are you using Wyse thin clients?
msidnamAuthor Commented:
No Wyse clients. Windows 7 desktops.

They called me back and we enabled debug and analytic logging for:


If they don't see anything in those logs they said they will need to do an RDP Trace.
msidnamAuthor Commented:
Just a quick update. M$ is still looking at our logs.
Robin CMSenior Security and Infrastructure EngineerCommented:
Thanks for the update! They seem to be foxed... You get bonus points if they release a hotfix for this issue ;-)
msidnamAuthor Commented:
LOL. I think I've stumped them for sure. They've been looking at the logs for a week.
msidnamAuthor Commented:
a quick update. They now have us running traces using Netmon and something called RDSTrace.exe on both client and servers.
Robin CMSenior Security and Infrastructure EngineerCommented:
Wow, interesting that this is still not fixed. Thanks for the update!
msidnamAuthor Commented:
Still waiting on a reply from Microsoft support.
Robin CMSenior Security and Infrastructure EngineerCommented:
This had better be worth the wait...! ;-)
msidnamAuthor Commented:
Still waiting for M$. they have not contacted me in over a week.
Robin CMSenior Security and Infrastructure EngineerCommented:
Any progress?
msidnamAuthor Commented:
Nothing yet. They had us change more registry settings but we are still getting disconnects. I will say, it's less than when we started but we still get them. I also had our MPLS provider check our routers and they did say they made some changes, in particular QOS settings, but nothing seems to be solid.

Very, very frustrating. Especially since we have a 2008 RDS Farm with no disconnect issues.
msidnamAuthor Commented:
Hello Everyone. A quick update. Microsoft I think has given up. they havent called me in several weeks. I've been doing my own research and came across this TECHNET post.

I've installed kb2984006 on my windows 2012 R2 servers and I uninstalled kb2923545 on my windows 7 clients. I just did this last night and I am having my users test today to see if we get any disconnects.

Hopefully i can give you all a solid answer tonight or tomorrow.
Robin CMSenior Security and Infrastructure EngineerCommented:
We may have covered this already ages ago, but is the data going through any kind of firewall between the server and the client? I wonder if the firewall is chopping the connection if it thinks it has been idle for too long: http://kb.juniper.net/InfoCenter/index?page=content&id=KB7046&actp=search
I had this recently with a web application, and increased the session timeout on the internal Juniper SRX firewall to stop SQL sessions being disconnected, which resolved the problem.
msidnamAuthor Commented:
No firewalls between the MPLS connections. We do have a device called Talari that takes in our MPLS and backup Comcast line in case one goes down and also a device called secnap that is an IDS/IPS. I've contacted both vendors and they don't see anything that would be causing the disconnects. I've even called our MPLS provider since they manage the routers and they don't see anything.
bbaoIT ConsultantCommented:
> Microsoft escalated this to the network team.
> We ran packet captures between the clients and workstations.

as the error codes suggested, it should be a license related issue at Application Layer, not something down to Network Layer. are you still using the trial licenses?
msidnamAuthor Commented:
No. We've been using the real licenses for a while now.
bbaoIT ConsultantCommented:
if so, i would suggest you to set up another server for test with the exact same software configurations and settings. of course, this time you apply authenticated license directly, NOT any trail license.

if the test server works well without the same issue, that means something wrong in the software build.

sometimes, MS products are funny, you have to or better install them from the scratch. no upgrade, no trail.
Robin CMSenior Security and Infrastructure EngineerCommented:
Ah well, worth a shot. Bit rubbish if MS have gone silent on you though. Presumably you had to pay them?
msidnamAuthor Commented:
Yea, we payed $499.

I have good news and bad news.

Good news is we fixed it.

Bad news is the fix is to move to Windows 8.1 (with this PATCH) or to Windows 10.

The other thing we did that also seemed to fix it is to use another RDP program with Windows 7 (like parallels 2x) instead of the native client.

We had a group of users using the 2x client and one user using Windows 8.1 and all of them had not only no disconnects but the RDP session was much faster.

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
Robin CMSenior Security and Infrastructure EngineerCommented:
Glad it's sorted for you finally :-)
msidnamAuthor Commented:
Also, this patch is needed on the windows 8.1 client as well: https://support.microsoft.com/en-us/kb/2984006
msidnamAuthor Commented:
This was the only solution that worked.
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.