win2008+ 如何cmd开启远程桌面

win2008+ 如何cmd开启远程桌面

Windows 2012、Windows 2008 Server命令行开启3389远程桌面,

命令行执行代码:

    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
        ######只允许带网络级身份验证的远程桌面的计算机


    //    wmic /namespace:\\root\cimv2\terminalservices path win32_tsgeneralsetting where (TerminalName ='RDP-Tcp') call setuserauthenticationrequired 0
        ######允许任意版本远程桌面的计算机连接(较不安全)


    reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fSingleSessionPerUser /t REG_DWORD /d 0 /f

附Windows 2003命令行开启3389一句话命令:

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