Remotely enable Remote Desktop under Windows XP
Command Line version:
If Windows Firewall is enabled on the remote PC, and no exception has been previously setup for Remote Desktop, you'll need to create one. We'll get a remote command prompt with PsExec from PsTools and check the firewall state:
C:\>PsExec.exe \\remotepcname -u user -p "pass with spaces" cmd
PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Windows\system32>netsh firewall show state
Firewall status:
-------------------------------------------------------------------
Profile = Standard
Operational mode = Enable
Exception mode = Enable
...
Ports currently open on all network interfaces:
Port Protocol Version Program
-------------------------------------------------------------------
137 UDP IPv4 (null)
139 TCP IPv4 (null)
138 UDP IPv4 (null)
445 TCP IPv4 (null)
No exception exists for 3389 (the default Remote Desktop port), so we'll create one:
C:\Windows\system32>netsh firewall set portopening protocol = TCP port = 3389 name = "Remote Desktop Protocol" mode = ENABLE
Ok.
C:\Windows\system32>netsh firewall show state
...
Ports currently open on all network interfaces:
...
138 UDP IPv4 (null)
3389 TCP IPv4 (null)
445 TCP IPv4 (null)
...
Now the remote PC can be accessed normally via Remote Desktop.