You can make people's connection logoff with settings in group policy or with the Remote Desktop Session Host.
Everything below can be found at this technet article
In group policy there are two areas for these settings.
For user settings:
In group policy expand the following under user config.
Configuration, Policies, Administrative, Templates, Windows Components, Remote Desktop Services, Remote Desktop Session Host, Session Time LimitsUser
For the computer settings:
In group policy expand the following under computer config
Configuration, Policies, Administrative Templates, Windows Components, Remote Desktop Services, Remote Desktop Session Host, Session Time Limits
For the Remote Desktop Session Host Configuration you can get all the commands here
But, there is the following command you could set very low and they will be logged off even if they just close the session.
End a disconnected session
Specify the maximum amount of time >that a disconnected user session is >kept active on the RD Session Host >server. If you specify "Never," the user's >disconnected session is maintained >for an unlimited time.
When a session is in a disconnected >state, running programs are kept >active even though the user is no >longer actively connected.
If this is a terminal server make sure your application is designed to work on that environment. Ask the application designer. – Fixitrod – 2017-09-04T18:21:29.017
@Fixitrod It is a terminal server and the application works correctly. The issue is with the user when login twice. I want that every time the user closes the connection to automatically logoff his/her session. – david – 2017-09-04T20:31:16.987
Oh, that's a completely diffrent question but I can help you with that. In the terminal server configuration settings for this. I'll put an answer for that question. – Fixitrod – 2017-09-05T01:47:38.663