Issue 66 in cassia: cannot use the Stop-TSSesion -force on disconnected session

77 views
Skip to first unread message

cas...@googlecode.com

unread,
Dec 18, 2012, 4:03:36 PM12/18/12
to cassi...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 66 by flau...@gmail.com: cannot use the Stop-TSSesion -force on
disconnected session
http://code.google.com/p/cassia/issues/detail?id=66

What steps will reproduce the problem?
I am trying to find all disconnected Terminal server session to generate a
report. Then i want to disconect them with:

My report before:
ServerName: ! SYST460
UserName id State IdleTime LoginTime
-------- -- ----- -------- ---------
Disconnected 00:00:00
admin456 Disconnected 5.18:23:32.0590000 2012/12/10 03:35:40
admin123 Disconnected 4.14:23:32.4250000 2012/12/12 09:39:09

get-TSSession -ComputerName $currline -State Disconnected | Stop-TSSession
–Force

But i get:

ServerName: ! SYST460 = windows 2008 R2
Exception calling "Logoff" with "1" argument(s): "Access is denied"
à C:\Documents and Settings\myaccount\My
Documents\WindowsPowerShell\Modules\PSTerminalServices\PSTerminalServices.psm1:
ligne:631 caractère:21
+ $session.Logoff( <<<< $Synchronous)


Here with another situation:
This server was down but the script stops because i get this:

ServerName: ! SYST934
Exception calling "Open" with "0" argument(s): "The RPC server is
unavailable"
à C:\Documents and Settings\myaccount\My
Documents\WindowsPowerShell\Modules\PSTerminalServices\PSTerminalServices.psm1:
ligne:189 caractère:24
+ $TSRemoteServer.Open( <<<< )


What version of Cassia are you using (e.g. 2.0.0.60)? Yes

On what Windows version is your code running?
I run it from my PC = windowx xp




cas...@googlecode.com

unread,
Dec 27, 2012, 9:37:23 PM12/27/12
to cassi...@googlegroups.com
Updates:
Status: Invalid

Comment #1 on issue 66 by danports: cannot use the Stop-TSSesion -force on
disconnected session
http://code.google.com/p/cassia/issues/detail?id=66

Regarding your first issue: It looks like you have a disconnected session
without a username. This could be the services session (session 0) or
another system session that it wouldn't make sense to log off. Try skipping
sessions like that in your script, or catch and discard the exception that
is thrown.

Regarding your second issue: That error ("The RPC server is unavailable")
is the one you would expect when trying to connect to a server that is
down. You'd need to catch and handle that exception.

Reply all
Reply to author
Forward
0 new messages