The problem: you use terminal services in administration mode (which allows 2 sessions), now you cannot connect to the server because all sessions are used.

Windows 2000+ (includes Windows XP and 2003) have two command-line tools called qwinsta and rwinsta that can query and reset a remote session.

Query a server:
> qwinsta /server:192.168.12.12

Where 192.168.12.12 is the IP address or name of the non-accessible machine.

This will display something like this:

> qwinsta /server:192.168.12.12
SESSIONNAME USERNAME ID STATE TYPE DEVICE
console 0 Conn wdcon
rdp-tcp 65536 Listen rdpwd
rdp-tcp#470 Foo 1 Active rdpwd
rdp-tcp#471 Bar 3 Active rdpwd

To disconnect/reset Foo's session you would type this:

> rwinsta /server:192.168.12.12 1

the 1 is the Session ID which comes from our first query.

You probably noticed that rwinsta and qwinsta seems like strange names. This came from the Citrix Metaframe days which Terminal Services has descended from. It stands for:

qwinsta = Query WINdows STAtion
rwinsta = Reset WINdows STAtion

In Windows 2003/XP this tools are called tsdisconnect, but warning, do NOT use tsdisconnect without parameters, or you will kill your console session!