MENU

命令行一句话开启服务器远程终端3389

February 4, 2013 • Security

Windows 2003 & Windows XP

wmic RDTOGGLE WHERE ServerName='%COMPUTERNAME%' call SetAllowTSConnections 1

wmic path win32_terminalservicesetting where (__CLASS != "") call setallowtsconnections 1

REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f

执行结果:

正在安装 WMIC,请稍候。执行 (\\JOINR410-1\ROOT\CIMV2:Win32_TerminalServiceSetting.ServerName="JOINR410-1")->SetAllowTSConnections()
方法执行成功。
输出参数:
instance of __PARAMETERS
{
        ReturnValue = 0;

};

Windows 2008 & Windows 2012

wmic /namespace:\rootcimv2terminalservices path win32_terminalservicesetting where (__CLASS != "") call setallowtsconnections 1

wmic /namespace:\rootcimv2terminalservices path win32_tsgeneralsetting where (TerminalName ='RDP-Tcp') call setuserauthenticationrequired 1

reg add "HKLMSYSTEMCurrentControlSetControlTerminal Server" /v fSingleSessionPerUser /t REG_DWORD /d 0 /f

Windows 7

WMIc /namespace:\\root\cimv2\terminalservices path win32_terminalservicesetting where (__CLASS != "") call setallowtsconnections 1

wmic /namespace:\\root\cimv2\terminalservices path win32_tsgeneralsetting where (TerminalName ='RDP-Tcp') call setuserauthenticationrequired 1
最后编辑于: December 26, 2018 23:14
Archives QR Code
QR Code for this page
Tipping QR Code