Mark Michaelis' Weblog :
Updated: 9/1/2004; 6:51:44 AM.

 








Subscribe to "Mark Michaelis' Weblog" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

Subscribe To
Mark's Weblog

 
 

Saturday, November 02, 2002

Resetting a Terminal Server Session Via Command Line/Telnet
Google Search It

Those of us that administer remote machines through terminal services will no doubt have encountered times when they get disconnected but the terminal server session continues on. This would be no bit deal if it wasn't for the fact that there can only be a maximum of 2 sessions (assuming the Administration mode).  Once both sessions get used up there is no more remote connection and one can't administer the machine.

Fortunately there is a command line way to enable reset of a session.  Log in to the remote machine via Telnet, obviously this assumes you have Telnet running on the remote machine, and use the RESET SESSION command as follows:

RESET SESSION 1

In this example, 1 is the Session ID. The Session ID is usually 1 or 2 since you can only have two sessions in Administration mode.  However, to view a list of current sessions use the QUERY SESSION command:

QUERY SESSION

This will list out all the sessions on the computer along with their state, such as how long they have been idle.  Note that the help on the reset command is not very helpful unless you enter the full

RESET SESSION /?


7:01:39 AM   []    comment []

I had never thought about adding field of type TraceSwitch to every one of my classes as described in the Visual Studio.NET magazine article 6 Quick C# Bug Fixes.  I don't like the fact that to use the field you then need to always call System.Diagnostics.Trace.WriteLineIf( ) or System.Diagnostics.Trace.WriteIf( ) to take advantage of it.

I wanted to post some sample code in which I used this idea but I havn't figured out how to do this yet.  The enclosure field seems to be a possibility but it wants a URL and I don't have a URL to stuff on my local machine, at least not one that would be available on the remote server.  Hmmmmm...


6:52:00 AM   []    comment []

© Copyright 2004 Mark Michaelis.



 


November 2002
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Oct   Dec


Recent Posts