The ultimate solution for remote connection exceeding the maximum number of connections

Source: Internet
Author: User
Tags mstsc
Force Login

You can use mstsc/console/V: IP: Remote port to Force Logon during running. If you use the mstsc/console/V: IP: Remote port directly on the Remote Desktop Connection end, enter/console/V: IP: Remote port.

For example: mstsc/console/V: 221.221.221.221: 34567

 

Windows 2003 terminal services exceed the maximum number of allowed connections (Remote Desktop, solution). This is because Windows 2003 sets the maximum number of allowed connections limit, and you may close the connection directly instead of logging out after each connection, as a result, the number of connections exceeds the maximum number of connections. On Windows 2003 Server, you can set a group policy to solve the problem: Click Start> Run and enter gpedit. MSC, press enter, and open the Group Policy window. Then, choose computer configuration> Manage template> Terminal Service> session ", in the window on the right, double-click "set time limit for Disconnected Sessions" and set the "End disconnected session" Time to 5 minutes. The best solution is to log out every time you disconnect the connection.

========================================================== ====================================

How can I solve the problem that the maximum number of connections is exceeded on the terminal server?
This problem always occurs on the rented VM. As long as the connection is not normally disconnected, you cannot use this account to connect again.
Finally, the solution is as follows:
Start-run-gpedit. MSC-Computer Configuration-management template-Windows Components-Terminal Services-session
In the window on the right, set the time limit for Disconnected Sessions-select Enabled and select a time
Problem Solving

Other suggestions:
Start-management tools-terminal service configuration-server configuration-restrict each user to use one session
========================================================== ======================================
If the telnet port is enabled, you can use this method:

Step 1: First, you can telnet to this host (no matter which method you use). Of course, if you can directly operate the machine, you do not need to use the command line for direct operations, it is more intuitive to use the console. This is not a problem we are talking about.

Step 2. After telnet, check the login user first:
Enter the command: Query user
System return:
Username sessionname ID state idle time Logon Time
The Administrator console 0 is running.
User1 usermachine1 1 running
User2 12 disconnected

At this time, we can see that the root cause is different, depending on the specific situation.
See? Users with ID 0 are locally logged on, and users with ID 1 and ID 12 are 3389 logged on. The former is running, and the latter is disconnected, however, if it is disconnected, it still occupies system resources and channels. We need to kill it. Perform the following operations.

Enter the command: logoff 12

C: \> query user // check again
Username sessionname ID state idle time Logon Time
The Administrator console 0 is running.
User1 usermachine1 1 running

Step 3. If the Telnet function is disabled on the server (this is the default one), you can also extend the stored procedure through the xp_cmdshell of sqlserver, in the format of master. DBO. xp_cmdshell 'COMMAND content'. For more information, see Step 2. This method requires the permission to access xp_mongoshell.

when you log on to the terminal server through a Remote Desktop Connection, you may encounter errors such as "the maximum number of connections allowed on the terminal server is exceeded, the cause of this problem is that the default connections of terminal services are two links. If you log on to the Remote Desktop and exit without logout, the remote desktop window is closed directly, in fact, the session is not released, but is retained on the server. This will occupy the total number of connections. When the maximum number is reached, the above prompt will appear.
solution:
1. log out of the Remote Desktop rather than closing the window directly.
2. Restrict the time For Disconnected Sessions.
3. Increase the maximum number of connections.
2 3. You can modify the session time in either of the following ways:
1. Modify the session time from terminal service configuration
: run-TSCC. MSC-connection-double-click RDP-TCP or right-click-properties-session-select the first replacement user setting (o) -end a disconnected session [change the default value "never" to an appropriate time, for example, 30 minutes]
modify the maximum number of connections: select the "Nic" tab and change "Max connections" to the value you need. Of course, this value cannot be too large, otherwise it will occupy a large amount of system resources. However, the modified value does not seem to work here. When it is set to no limit, the situation described in this article will still appear.
2. Modify the slave Group Policy
win2003
the Group Policy level is higher than the terminal service configuration, when the Group Policy is enabled, the corresponding options in the terminal service configuration become gray and unchangeable
Run-gpedit. MSC-Computer Configuration-management template-Windows Components-Terminal Services
double-click "Limit connections" on the right and select "enabled"-enter the maximum number of connections allowed
win2000
1. start-run-gpedit. MSC-Computer Configuration-management template-Windows Components-Terminal Services-sessions
In the right window, set a time limit for Disconnected Sessions-select Enabled and select a time

If a solution already exists:
1. First, you can telnet to the host (no matter which method you use). Of course, it is better to operate the machine directly, but you do not need to use the command line for direct operations, if you know the password of the Super administrator, you can use opentelnet to open the telnet port of the remote server.Article.
2. After telnet, check the login user first:
Enter the command: Query user
System return:
C:> query user
Username sessionname ID state idle time Logon Time
K12update console 1 running
At this time, we can see that the possible differences are different, depending on the specific situation.
Users with ID 0 are locally logged on, and users with ID 1 and ID 12 are 3389 logged on. The former is running, and the latter is disconnected, however, if it is disconnected, it still occupies system resources and channels. We need to kill it. Perform the following operations.
Enter the command: logoff 1
3. If the Telnet function is disabled on the server (this is the default one), you can also extend the stored procedure through SQL Server's xp_cmdshell. The format is master. DBO. xp_cmdshell 'COMMAND content'. For more information, see Step 2. This method requires the permission to access xp_mongoshell.
The above method basically does not use remote machine telnet or SQL extension services.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.