Skip to content

cristianadrielbraun/RDP-Session-Cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RDP Session Cleaner

How to use it

  • Just compile it with a standar go build command. Or use the build.bat
  • From command line, just execute "sessioncleaner install" to install it as a service (or uninstall if you want to remove it)
  • It will look for a config file containing very basic configs. It MUST be in the same directory and it MUST be called "config.yml"
  • You can set a timeout before closing the session, a list of ignored users, and the posibility of enable or disable the logging into a text file.

The yaml file should look like this:

timeout: 5 --> seconds
ignored:
 - domain\user1 --> allways include the domain. Even if it's the local PC name
 - domain\user2
logtofile: true --> Boolean

Little FAQ

What is this?

Basically, it closes disconnected RDP sessions faster than the minimum time allowed by Microsoft (Which is 1 minute)

It's a minimal service that controls the RDP sessions status, and forces them to logoff inmediatly (or waiting a predefined amount of seconds)

Why is this?

The 1 minute limit from Microsoft was too much for my scenario. For several reasons, I REALLY needed to close these sessions inmediatly.

I made this for a very particular environment where we actually use RemoteApp, not fully desktop RDP sessions. When a session get disconnected, I know is safe to log it off.

However, be aware that this could not be feasible in all situations, and you are warned that it is -in most cases- a little dangerous to abruptly close an user session, and it may causes data lost

Where is this?

Of course, Windows only

How is this?

It creates a ETW session client listening to the RDP server events. When the event of a new "Disconnection" shows up, it triggers the logoff.

A very simple program

Who is this?

uhmm.. what?

The real heros

Finally, many thanks to:

they did the hard work

About

Closing Disconnected RDP sessions inmediatly

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published