Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Windows Tutorials»Automatically Log off Disconnected User Sessions on Windows

    Automatically Log off Disconnected User Sessions on Windows

    RahulBy RahulDecember 15, 20192 Mins ReadUpdated:July 20, 2021

    Many times users connect to remote Windows systems, do work, and close the remote session without properly log off the account. In that case, multiple applications, which are still running with that login session uses system resources. Sometimes it causes a slow response of our servers and creates pain for us. So this will be good to auto log off disconnected sessions from the Windows system.

    This tutorial will help you to log all the disconnected remote sessions on the Windows system. This tutorial has been tested with Windows Server 2019.

    Setup Auto Log Off Disconnected Sessions

    We are making changes in the Local group policy of systems. So be careful with the changes.

    First of all, open the ‘Group Policy Editor‘ on your server. Start run window by pressing “Win + R” and type gpedit.msc on run window.

    Windows edit group policy

    The local group policy editor will be opened on your system. Then navigate to the following location as the below given instructions:

      Local Computer Policy 
       =>  Computer Configuration 
         =>  Administrative Templates 
    	=>  Windows Components 
              =>  Remote Desktop Services 
                =>  Remote Desktop Session Host 
                  =>  Session Time Limits
    

    Windows remote session timeout limit

    You will find a list of options on the right-side. Then Double click on “Set time limit for disconnected sessions” to open it.

    Disconnected User Sessions on Windows

    By default, it is configured a ‘Not configured. Change this to ‘Enabled. Now you will see an option “End a disconnected session” in the lower-left side. Set this value to the desired time. I have set this to 1 hour, so any disconnected user is logged off after 1 hour.

    Conclusion

    In this tutorial, you have learned to configure your Windows system to auto log out disconnected remote sessions.

    remote-desktop session windows
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install Nginx with PHP-FPM on CentOS 8
    Next Article How to Enable Passwordless Sudo for User in Linux

    Related Posts

    How to Enable / disable Firewall in Windows

    Updated:May 17, 20222 Mins Read

    How to Start & Stop Windows Service via Command Line

    Updated:March 29, 20222 Mins Read

    How to Change Windows Hostname (Computer Name)

    Updated:March 11, 20223 Mins Read

    How To Install NVM on Windows

    Updated:April 16, 20223 Mins Read

    How to Check Computer Uptime in Windows

    3 Mins Read

    How To Enable Multiple RDP Sessions on Windows Server

    Updated:May 17, 20222 Mins Read

    8 Comments

    1. Simmi Decker on August 10, 2021 11:03 pm

      I created this GPO on my domain controller and linked the GPO to Servers OU and in security filtering set to Authenticated users. However it doesnt seem to be working, As far as I know it will only work for new connections when users RDP to servers. So existing RDP disconnected users I have logged off via a PowerShell script. Any help will be appreciated thanks

      GPO Details:
      Computer Configuration (Enabled)
      Policies
      Administrative Templates
      Policy definitions (ADMX files) retrieved from the central store.Windows Components/Remote Desktop Services/Remote Desktop Session Host/Session Time Limits
      Policy Setting Comment
      End session when time limits are reached Enabled
      Set time limit for disconnected sessions Enabled
      End a disconnected session 8 hours

      User Configuration (Enabled)
      No settings defined.

      Reply
      • Chris on September 3, 2021 3:04 pm

        I have a feeling it is for new sessions. If there are existing ones when the policy gets applied, they likely have to be kicked, then the next time they log in the policy will take effect. That said, I’d like to see your PS script for logging off disconnected users.

        Reply
      • Paul on September 13, 2021 9:02 pm

        You may want to look at loopback if you’re wanting to apply computer settings to the members of a user group.

        Reply
    2. ElAnton on October 11, 2020 3:44 pm

      So much thank you. I can’t find solution.

      Reply
    3. Ken Castleberry on July 29, 2020 4:53 pm

      Great set of instructions, many thanks Rahul.

      Reply
    4. Muhammad Baiquni on July 3, 2020 12:00 pm

      Hello,

      It seams this not work to me. I’ve set the time to 10 minutes and running command gpupdate /Force but no user logoff.

      Reply
    5. Peter Jaffray on December 24, 2019 3:46 am

      What would this be for? Is this for people using RDP?

      Reply
      • Rahul on December 24, 2019 4:33 am

        Yes

        Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.