[THIN] Re: session kill

  • From: Jason CitrixADmin <jasoncitrix@xxxxxxxxx>
  • To: thin <thin@xxxxxxxxxxxxx>
  • Date: Fri, 6 Jun 2014 09:20:20 -0400

I found the following script that is supposed to handle disconnected
sessions, but I think it kills ALL disconnected sessions, not just those
belonging to a user.
Since I am not very good with scripts perhaps someone can verify, and
verify that it works across morethan one server.



















* Logoff Disconnected Sessions' If you want to logoff active sessions as
well, change the query to include' cActiveOn Error Resume NextConst cActive
= 0Const cDisconnected = 4Const strComputer = "."Set objWMICitrix =
GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer &
"\root\citrix")Set colItems = objWMICitrix.ExecQuery ("Select * from
Metaframe_Session Where sessionstate = " & cDisconnected)For Each objItem
in colItemsif (objItem.SessionID > 0) and objItem.SessionID
thenobjItem.Logoffend ifNext*
*Set objWMICitrix = Nothing*



>  Hej,
>
> first: many thanks, i've seen the script, tested and deployed it. As icon
> the red Powerbutton from Shell32.dll, a descriptive name - no room left for
> questions like "What's that for".
>
> One Question / an observation i made: what about disconnected sessions?
> As far as i've seen they aren't logged off.
>
> cheers, Marcus
>

Other related posts: