Can not disconnect session (pooled virtual desktop).

It's a 2012R2 server with win7 pooled virtual desktops. Disk usage of these desktops is somewhy high. They'd used all space at the volume and lost profile disks. After reboot and incrising that volume i've found that the vms where not rebooted but "saved". Users even said there were no reboot. After relogin they managed to work again except one.

I've restarted his vm in collection manualy but server manager still shows the session of this user. I can't disconnect it getting erros "Unable to disconnect session 147 on host.domain. WTS API failed". PS commands return errors too. Can i disconnect this session somehow or reboot of the server is the only option?

March 17th, 2014 9:51am

Hi,

Thank you for posting in Windows Server Forum.

Did you try to run the below command in PowerShell? Whats the result for that?
Disconnecting or logging off your users (Disconnect-RDUser, Invoke-RDUserLogoff)

If this is not possible to succeed, then finally you can try to reboot the server which will helps to resolve your issue.

Hope it helps!

Thanks,
Dharmesh
Free Windows Admin Tool Kit Click here and download it now
March 19th, 2014 2:37am

Thank you for reply.

When i try to log off this user grom gui I get error: "Unable to disconnect session... WTS API failed"

Disconnect-RDUser : Failed to disconnect user session. Error: 258

Invoke-RDUserLogoff : Failed to sign out from user session. Error: 258

Server or vm reboot do not help either! It just changes the UnifiedSessionID of the hanged session.

All other users do not have such problems.

It is some kind of magic from MS when even server reboot does not close session :)

March 19th, 2014 5:15am

I've found several simmilar cases at different forums. Now i've got another user with "disconnected session" who can not connect. Is this some sort of bug in Microsoft VDI? Was it too brave for me to try MS technology wich is "only" 2 years old?
Free Windows Admin Tool Kit Click here and download it now
March 27th, 2014 7:25am

Is there any way to make Connection broker get rid of a hanged session? Why is it still exist after host system restarted?
March 27th, 2014 7:29am

I am seeing the same behavior.  Anyone find a way to clear a hung session?  Rebooting the server is obviously going to be an issue in a production environment.
Free Windows Admin Tool Kit Click here and download it now
May 14th, 2014 3:04pm

I opened a ticket with MS on this and the fix was to restart the connection broker service.
May 28th, 2014 2:09pm

Hi Cleik,

do you have any new information? But I have same problem :-(

Free Windows Admin Tool Kit Click here and download it now
August 4th, 2014 10:14am

Sorry if this doesn't apply. I was experiencing these same errors. What I discovered was the user had disconnected from their session. The VM sat idle long enough to go to 'save' state. To resolve, that is allow me to 'log off' the user, I had to power back on the VM that corresponded to the users session. Wait, allow it to boot up. Then when I selected log-off the VM would restore itself and log the user out. On a few I had to reboot the VM before this would work. I figure one way to keep this happening to me in future will be to set a save delay that is a little longer than what I'll set my force log-out when disconnected session time.

August 27th, 2014 10:42pm

No nothing newer than what I had posted here.
Free Windows Admin Tool Kit Click here and download it now
September 23rd, 2014 9:13pm

1. Find VM with the hanged session.

2. Shutdown it using HyperV Manager or powershell

3. Revert to snapshot using HyperV Manager or powershell

Usually it helps. If not  - we can allways recreate the Pool.


October 20th, 2014 1:08pm

If you are running in a failover environment, you can live migrate the VDI that has the stuck account to another host and that will clear out the stuck connections, too. No need to mess with restarting anything in that scenario.

Mike

Free Windows Admin Tool Kit Click here and download it now
February 10th, 2015 6:18pm

Next time I run into this I will try the failover option.  Thanks Mike.
March 26th, 2015 4:15pm

Probably not the answer you want but have you tried logging into the vm and disconnecting the user via query session and reset session in cmd.exe.

https://technet.microsoft.com/en-gb/library/bb491025.aspx

Free Windows Admin Tool Kit Click here and download it now
June 30th, 2015 11:34am

Still running into this issue where no one is logged into a virtual desktop but Server Manager shows that they are and what I've found is that restarting the Hyper-V Virtual Machine Management Service which will also restart the Remote Desktop Virtualization Host Agent fixes the issue.
August 3rd, 2015 11:09pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics