You and myself included would hope not, however there may just be a day in your Citrix career when you receive a phone call from a user telling you how they cannot get logged on to Citrix or that their session has frozen and they cannot end the session.
Sure, you might try and log them off via Citrix Director or kill the session via Remote Desktop Services Manager but what if that doesn’t work? What if no matter how many times you click that reset or logoff button nothing happens? What if you try and kill every session process initiated by the user one by one but still one or more of the processes remain?
Now, you are thinking “I will have to restart the XenApp server at this stage”, but you may have 5, 10, 15, 20+ users concurrently sharing that single XenApp server! Not as simple as just restarting because now you are going to affect a larger user base.
You have two options:
- Send all currently logged on users a message asking them to log out. All whilst doing this the affected user has to wait unproductively
- Run a PowerShell command to hide the affected users session so that they can log on to a new session on another XenApp server
Running this PowerShell command, you will have the affected user up and running quickly and you can worry about draining and restarting the server at a more convenient time or without as much urgency.
Within Citrix Studio, launch PowerShell or add the Citrix.Broker.Admin.V2 module to your PowerShell session.
Run command Get-BrokerSession -username DOMAIN\affectedUsername | Set-BrokerSession -hidden $true
Now, run Get-BrokerSession -username DOMAIN\affectedUsername and you can see the Hidden flag will now be set to True. This has set the affected users broken session as hidden. At this stage, the user can launch a Desktop from receiver and it should connect to a different desktop hosting machine in the pool without any fuss.