[THIN] Powershell for Self Service User Logoff of all XenApp 6.5 sessions

  • From: James Scanlon <scanjam@xxxxxxxxxxx>
  • To: Thin <thin@xxxxxxxxxxxxx>
  • Date: Sat, 20 Sep 2014 01:22:41 +1000

Hey All,I want to write a script that we can publish to the end user (a 
published self service app??) that allows the end user to log themselves and 
all their Citrix sessions off completely on our XA6.5 farm.
Basically a click here to kill everything in Citrix if you cant access 
something and its 2am and the service desk are not available.There is lost of 
ideas out there, but was unable to find a 'whole of farm' logoff - or indeed a 
program that says - "Hello user, you are logged into servers X y Z, select the 
ones to stop and click next".... 
I am not much of a powershell scripter and after some searching and much trial 
and error I have gotten this far with the script,It seems to work sometimes, 
getting all the sessions for the user, other times it gets none but I believe 
its killing the session the script is being run under so its then unable to get 
to the other sessions and terminate them. I also still need to variablise the 
user name part too? 
Any one got any advice, ideas or tools that might help it would be greatly 
appreciated. :)
Add-Pssnapin Citrix*Get-XASession -Farm | Where-Object { $_.AccountName -match 
"Fred.Flintstone" } | stop-xasession


Other related posts: