Here it is

Open Powershell with the appropriate permissions, to enable MS RDP you may run the following command:

Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0

Running the command remotely

You may then run the command remotely, either via a pssession or invoke the command:

Invoke-Command -Computer $computername -Command {Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0}

Source: https://www.thewindowsclub.com/enable-remote-desktop-using-command-line