Killing User Sessions in XA 6.5 with Powershell

Hey, just a handy tip I picked up from the Citrix Engineers LinkedIn group.  Have you ever wanted to kill a single user’s sessions across multiple servers?  Or to clear all disconnected sessions on a farm to free up resources?  Here are two easy powershell scripts you can run that will do just that.  You must be a Citrix farm admin, and you must have the snapin loaded with Add-PSSnapin Citrix.XenApp.Commands:

Kill all sessions with a command
Get-XASession | Where{$_.AccountName -eq “username”} | Stop-XASession

Kill all Disconnected Sessions in the farm
Get-XASession | Where{$_.State -eq “Disconnected”} | Stop-XASession

We are building a simple script from these and other similar commands to give our Help Desk users simple task abilities like this without needing the full console.

, ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">