0% found this document useful (0 votes)
12 views

Automatically Log Off Disconnected User Sessions On Windows

Uploaded by

Au Suerte Felipe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Automatically Log Off Disconnected User Sessions On Windows

Uploaded by

Au Suerte Felipe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

TecAdmin 

Home » Windows Tutorials » Automatically Log off Disconnected User Sessions on Windows

Automatically Log off Disconnected


User Sessions on Windows
By Rahul — December 15, 2019  2 Mins Read — Updated: 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. Privacy - Terms
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

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

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
Privacy - Terms
In this tutorial, you have learned to configure your Windows system to auto log out
disconnected remote sessions.

LENUS Open
LAZULI

remote-desktop session windows

     

 PREVIOUS ARTICLE NEXT ARTICLE 

How to Install Nginx with PHP-FPM on How to Enable Passwordless Sudo for
CentOS 8 User in Linux

RELATED POSTS

Privacy - Terms
How to Check Computer Uptime in Windows How To Enable Multiple RDP Sessions on
August 4, 2021
Windows Server
July 20, 2021

How To Install XRDP (Remote Desktop) on


Debian 10
June 18, 2021

8 COMMENTS

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
Privacy - Terms
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 

ElAnton on October 11, 2020 3:44 pm


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

Ken Castleberry on July 29, 2020 4:53 pm


Great set of instructions, many thanks Rahul.
REPLY 

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 

Peter Jaffray on December 24, 2019 3:46 am


What would this be for? Is this for people using RDP? Privacy - Terms
REPLY 

Rahul on December 24, 2019 4:33 am


Yes
REPLY 

LEAVE A REPLY

Your Comment

Name *

Email *

Website

Save my name, email, and website in this browser for the next time I comment.

POST COMMENT

Privacy - Terms
LATEST ARTICLES

How to Check Disk Space in Ubuntu


October 19, 2021

How To Install and Switch Desktop Environments in Fedora


October 15, 2021

How to Git Remove File but Keep Local Version


August 9, 2021
Privacy - Terms

H t Cl Git R it I t S ifi F ld
How to Clone a Git Repository Into a Specific Folder
October 14, 2021

TAGS

Apache aws bash CentOS 8 command cpanel database date

debian Debian 9 Debian 10 Docker fedora file git Java javascript js

lamp Laravel linux mail mariadb mongodb MySQL nginx node

node.js NodeJs npm nvm PHP php framework PostgreSQL Python


Python3 security SSH SSL string tomcat Ubuntu Ubuntu 18.04

Ubuntu 20.04 windows

   

© 2021 Tecadmin.net. All Rights Reserved | Terms | Privacy Policy

Privacy - Terms

You might also like