Forum Discussion
Managing disconnected users in AVD hostpool
Most often end users doesn't sign out from AVD and their session state comes as Disconnected and then when they try to sign in after 15-20 min their profile experience problem.
Please suggest best way to deal with this kind of issue?
So far I have used the default group policy but it triggers after 1 hours, and they don't work specially when signed in via remoteapp.
- FBackeBrass Contributor
abhishek02687
Hi, we used to have a GPO that signed out disconnected sessions after about 3 hours due to customers insisting that "we demand being able to be away from the computer for a long time, and when we get back we should not have to sign in again".
This worked fairly OK until some of our customers got a ton of issues with FSLogix "DeadLocks" (earlier versions of FSLogix) due to the disconnected sessions not being able to sign out properly.
After a discussion with MS support they told us we should change the GPO to a maximum 15-30 minutes before disconnected sessions end.
So after that, we tweaked it a bit and implemented the following, and it has worked great ever since, even with the older versions of FSLogix. (The GPOs are probably not overall best practice, and it might not fit your needs, but it works great for us so just wanted to share.Computer Config:
Windows Components/Remote Desktop Services/Remote Desktop Session Host/Session Time LimitsSet time limit for active but idle Remote Desktop Services sessions Enabled Idle session limit: 3 hours Set time limit for disconnected sessions Enabled End a disconnected session 30 minutes Set time limit for logoff of RemoteApp sessions Enabled RemoteApp session logoff delay: 5 minutes - Ajni KurtajCopper Contributor
does this also work on windows 11 multi session ?
How about PS:
$disconnectedTimeLimit = 30 # Time in minutes Get-RDUserSession | Where-Object { $_.SessionState -eq 'Disconnected' -and $_.DisconnectTime -lt (Get-Date).AddMinutes(-$disconnectedTimeLimit) } | ForEach-Object { Invoke-RDUserLogoff -HostServer $_.HostServer -UnifiedSessionID $_.UnifiedSessionID -Force }