Disconnecting a Terminal Server Session

59 views
Skip to first unread message

aburrow

unread,
Aug 4, 2011, 2:51:05 AM8/4/11
to Cassia Users
I was looking at Disconnect Session and LogoffSession today.

Getsessions display a number of Disconnected Sessions on the terminal
Server, however when I try to use Disconnect Session nothing happens.

As soon as I change to LogoffSession the sessions that were showing up
as "Disconnected" are no longer there.

An example of my code

ITerminalServicesManager manager = new TerminalServicesManager();
ITerminalServer server = manager.GetRemoteServer(<servername>);
server.open();
server.GetSession(1).Logoff(true); - //This works for sessions that
are being reported back as Disconnected.
server.GetSession(2).Disconnect(true); - //This doesn't appear to do
anything.

I'm hardcoding my sessionID's at the moment, but will change the
variable's.

Anthony B

Chris Wright

unread,
Aug 4, 2011, 9:35:25 AM8/4/11
to cassia...@googlegroups.com
In Terminal Services, a disconnected session is when a user is logged
in to remote desktop but doesn't have a terminal hooked up to their
session. You load up a document, edit it, then disconnect and go to
the office and log in again, and your document's still open.

In other words, disconnecting a session stops it from receiving input
from or sending output to whichever remote computer is connected to
that session.

A logged off session is one where the user logged off, shutting down
all programs, etc. Once a session has been logged off, it shouldn't
appear in the list of sessions. (I'm not sure whether there is a time
delay here.)

What do you want to do to disconnected sessions? Get rid of them
entirely? In that case, use Logoff. Make sure nobody's actively
connected, but it's okay to be running programs (eg planned network
outage)? Disconnect should work.

Cheers,
Chris Wright

> --
> You received this message because you are subscribed to the Google Groups "Cassia Users" group.
> To post to this group, send email to cassia...@googlegroups.com.
> To unsubscribe from this group, send email to cassia-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cassia-users?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages