Use PSEXEC to enable RDP on a machine

  1. psexec \\remotecomputername -u username -p password reg add “hklm\system\currentcontrolset\control\terminal server” /f /v fDenyTSConnections /t REG_DWORD /d 0
  2. psexec \\remotecomputername -u username -p password netsh firewall set service remoteadmin enable
  3. psexec \\remotecomputername -u username -p password netsh firewall set service remotedesktop enable

Notes:

To run the command as administrator use “-h”

  • Example –
    • psexec \\remotecomputername -u username -p password -h netsh firewall set service remoteadmin enable

To have it prompt you for a password so you don’t have to enter it in plain text don’t use the -p command

  • Example –
    • psexec \\remotecomputername -u username netsh firewall set service remoteadmin enable
Advertisements