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.
Power Management, Powershell XenApp scripts, XenApp 6.5