Docs ms commandline regedit
From Remote Desktop Wiki
You can turn on Terminal Services and Remote Desktop on Windows using a single command line:
reg add “HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server” /v fDenyTSConnections /t REG_DWORD /d 0
Or from within the Registry Editor modify the registry key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
and set the value data from
fDenyTSConnections: 1 (hex)
to
fDenyTSConnections: 0 (hex)
then close the Registry Editor.

