China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-31 21:17
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Original] Introduction and Troubleshooting of Remote Desktop Protocol (RDP), Application Tips of WSH View 4,280 Replies 2
Original Poster Posted 2006-10-22 18:52 ·  中国 台湾
初级用户
Credits 36
Posts 11
Joined 2006-09-26 22:47
19-year member
UID 63740
Status Offline
Xiao Tianzai 2006/10/22

I. Preface:

1.

If you need to remotely manage the Server, after installing Windows 2003 Remote Desktop Connection, it initially supports 2 Session connections, but these Session permissions are only given to the Administrator for remotely managing the Server. However, sometimes when using Remote Desktop Connection (RDP Protocol), there may be situations where it hangs or the logged-in administrator forgets to log out, causing a freeze. When trying to connect, an error message "The remote computer's connection has exceeded the maximum limit and remote connection cannot be performed" may appear. Therefore, it is recommended to additionally install other remote management tools such as VNC for emergencies. This way, you can have 2 RDP Sessions + 1 VNC Remote Console connection count in operation.

2..

In the remote management of Windows, in the 2003 version, there is a newly added service called Termianl Server, which can allow more than 50 users to log in to the remote host for management. But this service requires a license. Initially, it is only allowed to be used for free for 180 days. If you accidentally start this for remote connection management, after 180 days, you will find that you cannot log in to the remote host! This should be noted. If you want to install the Termianl Server service, you can install it additionally in the place where you add or remove Windows components.



II. Explanation of management skills in remote connection management


Problem One

Since it is remote management, occasionally someone may connect but forget to log out. At this time, you can forcefully log out the user's connection Session in the following way:

Method:
You can use the TSadmin command to open the Terminal Services Administrator, check who is hanging on the Server, and if necessary, you can forcibly log them out or reset the RDP Session to forcefully interrupt it! Also, as mentioned earlier, if an error message "The remote computer's connection has exceeded the maximum limit and remote connection cannot be performed" appears when trying to connect, what should be done? You can't connect in, and if you haven't installed VNC or something, it seems there is only the way of restarting. So, to avoid RDP hanging, it is still recommended that you can additionally install something like VNC as a backup for use, or write a Script and place it on the remote host's TsakSchdule to test if RDP is hanging. If it is hanging, reboot it. But this is really a method used when there is no other way. If it is a Server operating important services, it is still not recommended to do this.

Problem Two

Since there is a limit of only 2 connection Sessions for remote desktop, what should be done if there are often many people connecting and many Sessions get stuck on it, causing me to be unable to log in?


Method:

Usually, the administrators should not be a large number of people. No one would often scramble to connect. So two connection Sessions are actually enough. But here, let's still talk about adjusting the number of connections. The operation process is as follows~

1. Select Run and enter gpedit.msc

2. At this time, the Local Security Policy setting will be opened

3. In Local Computer Policy > Computer Configuration > Administrative Templates > Windows Components > Terminal Services, set the desired number of connections and it will be done^^.

Problem Three

If an error message "The remote computer's connection has exceeded the maximum limit and remote connection cannot be performed" appears when connecting in, can you forcibly switch to the current connection Session on the remote Server?

Method:

This is seen on the Microsoft official website. You can use the command mstsc -v:servername -console to log in to the host console session. (Remember that the host to be connected to needs to have mstsc.exe installed! That is the thing of the Remote Desktop Client side.) I haven't tried if it can really forcibly switch over. You can give it a try!

Remarks:

If you really still can't connect in, you can't go to the computer room to restart it from a long distance. If the computer room is in Hong Kong, then it would be =_=……. Unless that host is dead and the network is disconnected, you must fly over to fix it. Otherwise, you can use the following method. The following provides a Windows WSH Scripts. When all methods don't work, issue a command to restart remotely!

Restart the remote installed Windows operating system WSH Scripts

(Cut and paste the following code, save it as reboot.vbs, and then click on it. The remote host will restart. Please note that there must be a group of the same account and password on the local control end and the remote controlled end host!

strComputer = " 10.1.1 .98" Please change the IP to your own remote host IP in this line)

--------------------------------------------------------------------------------------------------------------------------------------

strComputer = " 192.168.1.1 "

Set objWMIService = GetObject("winmgmts:" _

& "{impersonationLevel=impersonate,(Shutdown)}!\\" & strComputer & "\root\cimv2")

Set colOperatingSystems = objWMIService.ExecQuery _

("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems

ObjOperatingSystem.Reboot()

Next

-------------------------------------------------------------------------------------------------------------------------------------
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
redtek +2 2006-10-22 21:33
Floor 2 Posted 2006-10-23 02:47 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
The last script is not bad. However, you can't even connect to 3389. Generally speaking, the machine can only be restarted locally.

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 3 Posted 2010-12-04 15:29 ·  中国 广东 东莞 电信
新手上路
Credits 14
Posts 13
Joined 2010-12-01 15:41
15-year member
UID 178657
Gender Male
Status Offline
This is a bit hard to understand, but I can only learn a little at a time.
Forum Jump: