如果简单的设置,参照下图设置即可

然后gpedit.msc编辑组策略


如果需要多用户多会话,那么使用rdpwrap开源组件。
https://github.com/stascorp/rdpwrap
不同版本的windows需要不同的配置文件,请自行查找。
以下是一些参考
更新
https://github.com/rustaman2012/rdpwrapper
一些老的
https://github.com/infowayrs/INI-RDPWRAP
一些新的
https://github.com/sebaxakerhtc/rdpwrap.ini
如果需要空密码登录3389,可以修改组策略或者下面的批处理
echo 允许空密码连接设置
reg add HKLM\SYSTEM\CurrentControlSet\Control\Lsa\ /v limitblankpassworduse /d 0 /f
taskkill /f /im explorer.exe & start explorer.exe

断开远程会话并把会话交还给本机,可以执行以下命令
@%windir%\System32\tscon.exe 0 /dest:console
@%windir%\System32\tscon.exe 1 /dest:console
@%windir%\System32\tscon.exe 2 /dest:console
@%windir%\System32\tscon.exe 3 /dest:console