A quick post on a batch file I found to enable RDP with Admin privileges remotely for a domain joined PC.
@ECHO OFF ECHO. ECHO *********************************** ECHO ** Enable RDP on a LAN machine ** ECHO *********************************** ECHO. ECHO. Note: Assumes target machine is in the domain! ECHO. set dest= set user= set pass= set /p dest=Enter IP of target machine: set /p user=Enter (admin level) username: set /p pass=Enter password: ECHO. ECHO. Allow firewall rule for RDP... psexec \\%dest% -u %user% -p %pass% netsh advfirewall firewall set rule group="Remote Desktop" new enable=Yes ECHO. Note: with error code 0 means it worked! ECHO. ECHO. Turn on RDP... REM build the .reg file >> \\%dest%\admin$\rdpon.reg ECHO Windows Registry Editor Version 5.00 ECHO.>> \\%dest%\admin$\rdpon.reg >> \\%dest%\admin$\rdpon.reg ECHO [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server] >> \\%dest%\admin$\rdpon.reg ECHO "fDenyTSConnections"=dword:00000000 ECHO.>> \\%dest%\admin$\rdpon.reg REM run the .reg file psexec \\%dest% -u %user% -p %pass% regedit.exe /s c:\windows\rdpon.reg ECHO. Note: with error code 0 means it worked! ECHO. ECHO. Start the RDP service... sc \\%dest% start TermService REM cleanup the .reg file DEL \\%dest%\admin$\rdpon.reg ECHO. ECHO. ECHO. All done, you can now connect with Remote Desktop! ECHO. ECHO. set /p choice=Connect to %dest% now? (y/n) IF %choice%==y START "rdp" mstsc.exe /v:%dest% EXIT