Please wait,
Processing your request...

    0%
  Business logo VanSoest.it  
  ... | Selecteer de Nederlandse taal | Print this page. | Linkedin page of Johan van Soest | User: Guest | Login

Postcard image. Click this to mail to Johan

WebHalla
 Content
  Management
   System


ICT-Hotlist Topic

Back to the ICT-Hotlist...
Don't miss the latest updates

How to stop a RDP session so you can log on to remote desktop again.

The Remote Desktop Protocol (RDP) is a robust technology of Microsoft to take over and manage remote servers and PC's/Notebooks. RDP shows the user a graphical console of the other computer and allows the sending of key strokes and mouse movements to the same computer and even receive sound. Most servers allow up to 2 RDP sessions for system management, otherwise Client Access Licenses (TS-CAL's/RDP-CAL's) should be acquired and user(groups) must be added to the remote users group by "Select users who can use remote desktop"(Windows desktops), by Group policies or by the terminal server manager.
Adding Remote Desktop Users on a Windows 10 desktop
Adding Remote Desktop Users on a Windows 10 desktop

RDP is refused.

When you are locked out of an RDP connection with the error : "The terminal server has exceeded the maximum number of allowed connections", there are probably 2 sessions not correctly logged off and are still active. There are two strategies without rebooting the server.
  1. RDP to the console of the server and stop the sessions using Task Manager, tab "Users" and disconnect the user sessions.
  2. Stop a session on the (remote) server (Also works on Citrix)

RDP to the server console to stop a session

By using the following command line code you start a Console session.
mstsc /admin
Next you have to enter an IP-address or server name in the dialog. Than start Task Manager, select the tab "Users" and stop the sessions. Now you should able to logon with RDP.

Locate the server sessions and stop these.

First get the session ID's of the running Remote Desktop protocol sessions by using the command:
query session /server:<server name or IP-address>

For example:

C:\>query session /server:nlaaldc1
 SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
 console                                     0  Conn    wdcon
 rdp-tcp                                 65536  Listen  rdpwd
 rdp-tcp#79        administrator             2  Active  rdpwd
 rdp-tcp#73        administrator             1  Active  rdpwd
 
Now you can terminate the RDP session with the Session ID using the command line interface command:
reset session <session-id> /server:<server name or IP-address>

For example:

reset session 2 /server:nlaaldc1
Now you should able to logon with RDP.

System requirements

Windows 2003 server, Windows 2003 R2 server, Windows 2008 server, Windows 2008 R2 server, Windows 2012 server, Windows 2012 R2 server, Windows 10, 8.x, 7

Standardize on RDP

On several Linux systems xrdp can be installed. This allow taking over a Linux console with Windows Remote Desktop tools. You receive a Linux X window to manage the machine.
You may vote your opinion about this article:


Topic created  :  01-05-2017
Topic last edited  :  11-05-2017

Scripts and programming examples disclaimer

Unless stated otherwise, the script sources and programming examples provided are copyrighted freeware. You may modify them, as long as a reference to the original code and hyperlink to the source page is included in the modified code and documentation. However, it is not allowed to publish (copies of) scripts and programming examples on your own site, blog, vlog, or distribute them on paper or any other medium, without prior written consent.
Many of the techniques used in these scripts, including but not limited to modifying the registry or system files and settings, impose a risk of rendering the Operating System inoperable and loss of data. Make sure you have verified full backups and the associated restore software available before running any script or programming example. Use these scripts and programming examples entirely at your own risk. All liability claims against the author in relation to material or non-material losses caused by the use, misuse or non-use of the information provided, or the use of incorrect or incomplete information, are excluded. All content is subject to change and provided without obligation.
Generated by WebHalla™ Version 0.1.e.2 : Tuesday 22-1-2019 © Copyright 1995-2019 Johan van Soest
Response Form    Cookie- and Privacy statement
Weather in Waalre by OpenWeatherMap logo mist
Temperature -3.76 °C mist
Humidity 85 % mist
Air pressure 1017 hPa mist
Wind speed 2.1 m/s mist
Wind direction South South mist