『楼 主』:
[原創] 远程桌面通讯协定(RDP)介绍及问题排除、WSH的應用技巧
使用 LLM 解释/回答一下
小田仔 2006/10/22
一前言:
1.
如果你需要远端控管 Server , 安装好 Widows 2003远端桌面连线,初始即可支援 2个 Session 连线,但此 Session 权限仅给予 Administrator 进行远端管理 Server 使用. 但使用远端桌面连线(RDP Protol) 有时也许会发生挂点的情况或是登入的管理人员忘记登出,而造成卡死的情况,要连线进入时出现(远端电脑的连线已经超过最大极限无法进行远端连线)的错误讯息,所以建议是能够再加装如 VNC 之类的其它远端管理工具,以备不时之需,这样在操作上就可以拥有 2个 RDP Session + 1个VNC Remote Console的连线数。
2..
在Windows的远端管理上,在2003版本上有新增一项Termianl Server的服务,可以让 50个以上的 User登入远端主机进行管理,但此项服务需要购买援权,初始下只充许免费使用180天,如果你不小心是启动这个进行远端连线管理,180天后你就会发现,不能登入远端主机喔!这个要注意一下,如果要安装Termianl Server服务,可以在新增移除Windows原件的地方进行新增安装。
二.远端连线管理上的管理技巧说明
问题一
既然是远端管理,偶而难免发生有人会连上去了,但是忘记退出的情况,这时可以下列的方式强制退出User的连线Session:
方法:
可以使用 TSadmin指令,开启终端机服务管理员,查看一下谁挂在 Server 上了必要时可以强制性将他LogOut或是 Reset RDP Session 强制中断掉!另外刚才前面提到的,如果是发生要连线进入时出现(远端电脑的连线已经超过最大极限无法进行远端连线)的错误讯息,这下怎么办,连也连不进去,又没装VNC之类的好像只有重开机一途了,所以为了避免因为RDP挂点,所以还是建议你可以额外再安装如VNC之类的当备援来使用,或是写个Script放在远端主机TsakSchdule上,测试RDP是否挂点,如果挂点就给它Reboot,但这是真的没办法才使用的方法,如果是运作重要服务的Server建议还是别这样做,。
问题二
即然远端桌面只能有2个连线Session的限制,那如果常有很多人连,常有Session卡在上面,造成我无法登入,那该怎么办?
方法:
通常管理人员应该不会是一堆人吧,没事就一堆人抢着连,所以二个连线Session其实就够了,但这里还是说一下调整连线数的设定吧,操作流程如下~
1.选择执行并输入gpedit.msc
2.这时会开启本机安全性原则设定
3.在本机电脑原则>电脑设定>系统管理范本>Windows元件>终端机服务 里设定欲连线的人数就大功告成啰^^。
问题三
如果连线进入时出现(远端电脑的连线已经超过最大极限无法进行远端连线),可以强制切入目前远端Server上的连线Session吗?
方 法:
这是在微软官网上看到的,可以使用mstsc -v:servername -console这个指令来登入到主机console session.(记得要连线过去的主机上要装mstsc.exe喔!就是远端桌面的Client端的东东),没试过是否真的可以强制切过去,可以试试看!
备 注:
如果真的还是连不进去,总不可能大老远跑去机房重开机吧,如果机房是在香港,那不就 =_=…….,除非是那台主机死机了,网路断了,你就一定要飞过去弄了,不然可以使用下列方法,下面提供一个Windows 的WSH Scripts,当所有方法都不行时,远端下指令重开机吧!
重开远端安装Windows作业系统 WSH Scripts
(把下面程式码剪下贴上存成reboot.vbs然后点选,远端那台主机就重开机啰,请注意在本机控制端和远端被控端主机必须要有一组相同的帐号和密码喔!
strComputer = " 10.1.1 .98"这行请把IP改成你自己的远端主机IP)
--------------------------------------------------------------------------------------------------------------------------------------
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
-------------------------------------------------------------------------------------------------------------------------------------
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
-------------------------------------------------------------------------------------------------------------------------------------
|