Why terminal server is not allowing connections?

Posted on 2009-04-24
Last Modified: 2013-11-21

We have a Windows 2003 R2 Server that has Terminal Server CAL licenses (8), the server has been working since a few years ago without any problems, but today at the moment that any user tries to connect to it, a message appears: TERMINAL SERVER HAS ENDED THE CONNECTION.

I have restarted the server but didn´t work.

Any ideas?
Question by:dimensionav
    LVL 5

    Accepted Solution

    On the console of the server, can you check if the server is listening on port 3389, by typing "netstat -an"

    Can you connect to the server itself from the console?
    Is the TS Licensing Server now activated?
    Are sessions enabled? check with "change logon /query"

    try to check whetner the connections to TS is enabled. if not enable it by
    To enable a connection

    Open Terminal Services Configuration.
    In the console tree, click Connections.
    In the details pane, right-click the connection you want to enable, point to All Tasks, and then click Enable Connection.
    The connection is enabled and users can log on to the terminal server using the connection.

    To perform this procedure, you must be a member of the Administrators group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure. For more information, see Default local groups, Default groups, and Using Run as.
    To open Terminal Services Configuration, click Start, click Control Panel, double-click Administrative Tools, and then double-click Terminal Services Configuration.

    lastly if the above doesnot work run the following script and send me the output
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

    Set colItems = objWMIService.ExecQuery _
        ("Select * from Win32_TerminalServiceSetting")

    For Each objItem in colItems
        Wscript.Echo "Active Desktop: " & objItem.ActiveDesktop
        Wscript.Echo "Allow TS connections: " & objItem.AllowTSConnections
        Wscript.Echo "Caption: " & objItem.Caption
        Wscript.Echo "Delete temporary folders: " & objItem.DeleteTempFolders
        Wscript.Echo "Description: " & objItem.Description
        Wscript.Echo "Direct connect license servers: " & _
        Wscript.Echo "Disable forcible logoff: " & objItem.DisableForcibleLogoff
        Wscript.Echo "Help: " & objItem.Help
        Wscript.Echo "Home directory: " & objItem.HomeDirectory
        Wscript.Echo "Licensing description: " & objItem.LicensingDescription
        Wscript.Echo "Licensing name: " & objItem.LicensingName
        Wscript.Echo "Licensing type: " & objItem.LicensingType
        Wscript.Echo "Logons: " & objItem.Logons
        Wscript.Echo "Profile path: " & objItem.ProfilePath
        Wscript.Echo "Server name: " & objItem.ServerName
        Wscript.Echo "Setting ID: " & objItem.SettingID
        Wscript.Echo "Single session: " & objItem.SingleSession
        Wscript.Echo "Terminal Server mode: " & objItem.TerminalServerMode
        Wscript.Echo "Time zone redirection: " & objItem.TimeZoneRedirection
        Wscript.Echo "User permission: " & objItem.UserPermission
        Wscript.Echo "Use temporary folders: " & objItem.UseTempFolders

    Author Comment


    I´ll answer in order that you have asked:

    On the console of the server, can you check if the server is listening on port 3389, by typing "netstat -an"  <--- YES, IT´S LISTENING

    Can you connect to the server itself from the console? <---NO

    Is the TS Licensing Server now activated? <--- YES, ACTUALLY I HAVE DESACTIVATED AN REACTIVATED AGAIN

    Are sessions enabled? check with "change logon /query" <--- YES, ARE ACTIVATED

    In the details pane, right-click the connection you want to enable, point to All Tasks, and then click Enable Connection.<--- IS ENABLED, THERE ONE ELEMENT CALLED: RDP-Tcp

    In order to run your script, would you mind to explain a step by step process ? (sorry I´m kind of amateur on this), by the way, I have noticed that after restarting the server I can perform TS connection once, after that the error message appears again.

    LVL 5

    Assisted Solution


    The problems you described may occur if the RDP-tcp listener was not initialized or if the Terminal device driver is not started. You may have to verify that the license key is correct.

    1. You may need to reset the client license registry key as described in following Microsoft Knowledge Base article: 248430 How to Transfer Terminal Services CAL from One Computer to Another.

    2. The RDP-tcp connection may have to be reset. To reset the RDP-tcp connection in the Terminal Services Configuration management console, right-click the connection, and then click Disable. Confirm the changes when you are prompted to do so. Repeat the process, and then click Enable.

    3. The RDP-tcp connection may be corrupted. Re-create the RDP-tcp connection in the Terminal Services Configuration management console. To re-create the connection, delete the connection, and then re-create it.

    4. The Network Adapter tab in RDP-tcp properties may be set to Maximum Connections: 0. This causes the "The Terminal server has ended the connection" error message.

    5. The Terminal device driver files may be corrupted or missing. Verify the existence of the Termdd.sys and Rdpwd.sys files in the %SystemRoot%\Sytem32\Drivers folder. Verify that the Rdpdd.dll and Rdpwsx.dll files are located in the %SystemRoot%\Sytem32 folder.

    6. The TermDD service may be disabled. Open the registry and locate the following key:


    Check the data setting for the Start value, which should be 2. If the value is set to 4, the driver has been disabled. Set the value to 2, and then restart the server computer.

    Author Comment


    I have tried every solution that you provided except for:

    1. Solution One talks about contacting microsoft tech support, so I will do that by these days.
    2. Solution Five: there are no missing files, how to know if they are corrupted?
    3. Solution 6: The value was "1" but after has been changed for "2", remains the same problem



    Author Comment

    I have entered to:

    Viewing the status of the authorization number appears as "expired", does this mean that Open License of microsoft expires at specific time?, Do we have to pay again for those licenses? or is just matter of some kind of reactivating?


    Author Comment

    I have checked the registry searching for: HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing\Store\LICENSE00x, but that key doesn´t exist on both, server and workstation. I must say that licenses are per user.

    LVL 5

    Expert Comment


    if the status of your lics shows as expired, you would need to buy fresh ones.


    Author Comment


    What I have done is to restore the server a day before that the issue appeared and by know everything is working normally.

    Note: We have acronis making daily backups, so I just basically restored the OS but the rest of information is intact.

    Note2: I have investigated about "authorization number" that appears to be "expired" and that is somethig to do with a code for buying licenses and having special offers and prices but "open licenses" has no expiration as far as I read.

    I believe your posted information is quite valuable, I will let it as the solution, I just have a final question:
    How could I run your script and How should be interpreted?

    LVL 5

    Assisted Solution


    the script is to be copied into a file and saved with .wsf and click to open it.

    the script i forwarded you is to check the configuration of terminal server and its settings

    there are lot of other scripts available at

    Author Closing Comment

    Thank you very much

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    This is my 3rd article on SCCM in recent weeks, the 1st ( dealing with installat…
    Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip Migration Tip #1 – Source Server Health can be found listed in my profile here: http:…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    730 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

    15 Experts available now in Live!

    Get 1:1 Help Now