Citrix

Citrix log off script

Command to logoff all disconnected sessions in the farm,

Get-XASession -Farm | Where-Object { $_.State -eq “Disconnected”} | Stop-XASession
or
Get-XASession | where { ($_.state -eq “disconnected”) } | Stop-XASession

Command to logoff all disconencted sessions in single xenapp server

Get-XASession | where { ($_.state -eq “disconnected”) -and ($_.ServerName -eq “ctxsrv01”) } | Stop-XASession

 

And if you want to log off for particular applicationĀ 

Get-XASession | where { ($_.BrowserName -eq “<Application name>”) } | Stop-XASession