locked
Windows Server 2012 RemoteApp immediately logoff session after close app RRS feed

  • Question

  • Hi all,

    I have a strange problem with Windows Server 2012 R2 Terminal Services RemoteApp.

    When a user closes an application must be session on the Terminal Server are immediately logged out. Now it takes 20 seconds before the session is logged off.

    I have read the followd article: http://blogs.msdn.com/b/rds/archive/2007/09/28/terminal-services-remoteapp-session-termination-logic.aspx and i have changed some settings in the GPMC.

    Computer Configuration\Administrative Templates\Windows Components\Terminal Services\Terminal Server\Session Time Limits set to Immediately

    User Configuration\Administrative Templates\Windows Components\Terminal Services\Terminal Server\Session Time Limits set to Immediately

    It still takes 20 seconds before the session is logged off, how can i fixed this?


    Sincerely, Martien van Dijk -------------------------------------------------------------------------------- Please remember to mark the replies as answers if they help and unmark them if they provide no help. Check out My Blog!

    Tuesday, May 5, 2015 1:11 PM

Answers

  • Hi,

    The 20 second client disconnect delay is normal and there is no option to change it.

    If you absolutely need the session to end without waiting 20 seconds you could write a custom program/script that will end the session immediately after a specific program closes.  For example, if you only needed to publish a single RemoteApp you could publish a custom program that starts the intended application, waits for it to exit, and then runs logoff.exe immediately after.

    -TP

    • Proposed as answer by Amy Wang_ Sunday, May 17, 2015 2:58 PM
    • Marked as answer by Martien van Dijk Monday, May 18, 2015 6:45 AM
    Tuesday, May 5, 2015 4:07 PM
  • Hi,

    I have find the solution: I have create a batch file to logoff immediately the session after closing the software:

    "C:\Program Files (x86)\Microsoft Office\Office15\Outlook.exe"
    logoff.exe

    In RemoteApp the user opens the Batch file, through Powershell you can change the batch program icon to outlook 2013 icon. 

    thanks for the replies!


    Sincerely, Martien van Dijk -------------------------------------------------------------------------------- Please remember to mark the replies as answers if they help and unmark them if they provide no help. Check out My Blog!

    Monday, May 18, 2015 6:45 AM

All replies

  • Hi,

    The 20 second client disconnect delay is normal and there is no option to change it.

    If you absolutely need the session to end without waiting 20 seconds you could write a custom program/script that will end the session immediately after a specific program closes.  For example, if you only needed to publish a single RemoteApp you could publish a custom program that starts the intended application, waits for it to exit, and then runs logoff.exe immediately after.

    -TP

    • Proposed as answer by Amy Wang_ Sunday, May 17, 2015 2:58 PM
    • Marked as answer by Martien van Dijk Monday, May 18, 2015 6:45 AM
    Tuesday, May 5, 2015 4:07 PM
  • Hi,

    I have find the solution: I have create a batch file to logoff immediately the session after closing the software:

    "C:\Program Files (x86)\Microsoft Office\Office15\Outlook.exe"
    logoff.exe

    In RemoteApp the user opens the Batch file, through Powershell you can change the batch program icon to outlook 2013 icon. 

    thanks for the replies!


    Sincerely, Martien van Dijk -------------------------------------------------------------------------------- Please remember to mark the replies as answers if they help and unmark them if they provide no help. Check out My Blog!

    Monday, May 18, 2015 6:45 AM
  • Hi Martien,

    Glad to hear that you have solved the issue, thank you for sharing with us!

    Please feel free to let us know if there are any further requirements in the future.

    Best Regards,

    Amy


    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, May 18, 2015 7:41 AM
  • If create batch file run

    "C:\Program Files (x86)\Microsoft Office\Office15\Outlook.exe"
    logoff.exe

    That means open Outlook then logoff immediately?

    Seems it is not the way to solve the problem?

    Wednesday, January 24, 2018 3:36 AM
  • In batch, when you run an executable (depending on how it responds), it won't go to the next line until that "command" has completed (in this case, terminated).  So the Logoff will only run once the outlook.exe process has ended.

    Same will go for troubleshooting remote apps in this case.  If this is provisioned, and you have to end someone's outlook because it's stuck, it will automatically log them out.  Perfect!

    Tuesday, May 8, 2018 1:17 PM