I recently brought 2 colocated servers online running Windows 2003 Server. Being paranoid regarding security, especially on a production Windows server, I had the network people filter all traffic to the box except SMTP, HTTP and PPTP. I figured any other access I needed could be done over a VPN tunnel. Well, what I forgot to do was to enable Remote Desktop before I brought the box down to the NOC. So, when I got back to the office to test it, I could VPN in with no problems, but could not get a Remote Desktop.
I fired up the MMC, and connected to the remote machine. Terminal Services were running. Still couldn't connect via RDP. Did some digging online and found a way to enable Remote Desktop from the registry.
Launched regedt32.exe (can't use regedit.exe for remote registries), connected to the remote registry, and set the appropriate key. Voila! I was in! Here is the key / value you need to set:
KEY: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TerminalServer
DATA: fDenyTSConnections
VALUE: 0 = enable Remote Desktop / 1 = disabled
Posted under the influence of [[NiN :: the mark has been made]]
Thanks for posting this.... I was ready for a long hunt. I just had to restore my work PC all last night, was in the office all day and never did enable remote desktop.
This saved me a trip into the office tomorrow.
==== CODE ====
'==========================================
' NAME: EnableRemoteConnect.vbs
' AUTHOR: Kevin Dondrea, Support
' DATE : 9/16/2009
' COMMENT: Enables Remote Desktop Connect feature. It does not add a user with
' permissions who can login.
'==========================================
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server"
strValueName = "fDenyTSConnections"
strValue = "0"
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
==== END CODE ====
This code is to Disable Remote Connect
==== CODE ====
'==========================================
' NAME: DisableRemoteConnect.vbs
' AUTHOR: Kevin Dondrea, Support
' DATE : 9/16/2009
' COMMENT: Enables Remote Desktop Connect feature. It does not add a user with
' permissions who can login.
'==========================================
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server"
strValueName = "fDenyTSConnections"
strValue = "1"
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
==== END CODE ====