发现远程桌面忘记开了,或者连接满了,需要跑去机房 ,今天看了个资料,正好解决这个烦恼
下面介绍仅仅使用windows的一些命令来实现这个过程。仅供参考了。
一。我们可以直接通过在客户端输入wmic命令,来远程开启服务器的远程桌面,命令如下:
Wmic /node:"[full machine name]" /USER:"[domain]\\[username]" PATH win32_terminalservicesetting WHERE (__Class!="") CALL SetAllowTSConnections 1
这里的"full machine name“也可以是IP,"domain\ame”也可以是本机的帐号。 C:\\Documents and Settings\\admin>Wmic /node:"10.*.*.*" /USER:"monitor\\admini
strator" PATH win32_terminalservicesetting WHERE (__Class!="") CALL SetAllowTSCo
nnections 1
Enter the password :********Executing (MONITORrootcimv2:Win32_TerminalServiceSetting.ServerName="MONITOR
")->SetAllowTSConnections()
Method execution successful.
Out Parameters:
instance of __PARAMETERS
{
ReturnValue = 0;
};
C:\\Documents and Settings\\admin>Wmic /node:"10.*.*.*" /USER:"monitor\\admini
strator" PATH win32_terminalservicesetting WHERE (__Class!="") CALL SetAllowTSCo
nnections 0
Enter the password :********Executing (MONITORrootcimv2:Win32_TerminalServiceSetting.ServerName="MONITOR
")->SetAllowTSConnections()
Method execution successful.
Out Parameters:
instance of __PARAMETERS
{
ReturnValue = 0;
}; 二。可是,如果管理员是空密码,那就开启不了远程桌面了,windows默认是不能使用空密的远程桌面的。
如果使用wmic命令,会报错的。
这时候可以使用telnet来更改密码,telnet默认是不开启的,我们可以通过ipc$连接来开启,
整个过程如下,不多介绍了,都是很简单的命令:
1.建立IPC连接
net use \\\\IP password /user:administrator
2.把Telnet服务改成“自动”
sc \\\\IP config tlntsvr start= auto
注意:auto前面有一个空格
3.启动Telnet服务
sc \\\\IP start tlntsvr
4.Telnet到服务器
telnet IP
5.更改管理员密码
net user administrator password
6.使用wmic命令开启远程计算机的远程桌面
7.别忘了远程登录计算机后停用并禁用telnet服务!C:\\Documents and Settings\\admin>net use 10.*.*.* /user:administrator
The command completed successfully.
C:\\Documents and Settings\\admin>sc 10.*.*.* config tlntsvr start= auto
[SC] ChangeServiceConfig SUCCESSC:\\Documents and Settings\\admin>sc 10.*.*.* start tlntsvrSERVICE_NAME: tlntsvr
TYPE : 10 WIN32_OWN_PROCESS
STATE : 2 START_PENDING
(STOPPABLE,PAUSABLE,ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
PID : 2544
FLAGS :C:\\Docume
nts and Settings\\admin>telnet 10.*.*.*Welcome to Microsoft Telnet ClientEscape Character is 'CTRL+]'
You are about to send your password information to a remote computer in Internet
zone. This might not be safe. Do you want to send anyway(y/n): yTelnet server could not log you in using NTLM authentication.
Your password may have expired.
Login using username and passwordWelcome to Microsoft Telnet Servicelogin: administrator
password:*===============================================================
Welcome to Microsoft Telnet Server.
*===============================================================
C:\\Documents and Settings\\Administrator>net user administrator 00000000
如果超过最大连接数,可以运行 mstsc /v:IP /console 来连接到远程系统的的0会话(就是本地登陆)
C:\\Documents and Settings\\admin>mstsc /v:10.*.*.* /console如果是WINDOWS XP SP3那么主要注意,需要使用参数/adminC:\\Documents and Settings\\admin>mstsc /v:10.*.*.* /admin远端的windows防火墙关闭命令sc \\\\IP stop sharedaccess