Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Sever 2022 #362

Open
alimfazeel opened this issue Mar 14, 2023 · 3 comments
Open

Windows Sever 2022 #362

alimfazeel opened this issue Mar 14, 2023 · 3 comments

Comments

@alimfazeel
Copy link

HI

We recently upgraded our server from 2012 to 2022, We are trying to connect to WIn Server 2022 now,

User opens and close the session from application.

For closing, I need to trigger a script to close sessions properly.

Issue is,

  1. If windows user session is in open/disconnected state, it doesn't trigger that script but if it is in closed state, it triggers the script. Any solution?

Note: It was working fine with windows server 2012,

@Ireheart
Copy link

Same

@cedrozor
Copy link
Owner

cedrozor commented Sep 9, 2023

Hi,

What you can do is set the disconnection timeout to a low value, (i.e.: 1 sec) so that disconnected sessions are closed straight away after being disconnected. You can do it either from the RDS role settings (server administration) or the RDP host registry:

Download the file :

https://github.com/cedrozor/myrtille/blob/master/Myrtille.Services/RDPSetup.reg

Change "MaxDisconnectionTime" as below:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]
; hexa, 1000ms = 1sec
"MaxDisconnectionTime"=dword:000003E8

After editing the file (and removing the other values you don't need to change), import the value(s) into your registry (double click the file then accept import).

Note that it will break the "Reconnect on resize" feature of the Myrtille toolbar.

@alimfazeel
Copy link
Author

Hi @cedrozor

Thanks for your response,

in our use-case user runs some calculations and disconnects the sessions to keep the calculations running in the background so we cannot logoff user as per disconnection.

We want to logoff only when user click CLOSE button. We are generating session key with a 'cmd script' to logoff the user when CLOSE button is clicked. in Windows 2013, it was working absolutely fine.

But in Windows Server 2022, it is not running the script if windows session of the user is already logged in, in case user is logged off it works normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants