• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2467
  • Last Modified:

Log Off a Remote Desktop Connection User Using Access VBA

I have 70+ users that hammer my Access 2003 application via Remote Desktop Connection with an average of about 20 logged in at any time.

Although they have been trained to use the proper logoff procedure, I still have users that exit my application and 'X' to close the RDC session rather than Start/Logoff.  Terminal Services reports those users as disconnected but doesn't release the "seat" or resources.

I need a Windows call or script that I can execute on form close that will perform the Start, Logoff, Yes sequence.

Best regards,
Rick Farris
{ contact info removed by PenguinMod, EE Moderator }
2 Solutions
Toni UranjekConsultant/TrainerCommented:
Hi rhfarris,

Configure your server to end disconnected sessions in tscc.msc or Group Policy.

"Designing Terminal Server Connection Configurations"

Setting that you are looking for is called "End a disconnected session" on "Logon settings" tab in properties of RDP-Connector in tscc.msc.


On form close, you can run shutdown.exe:

Shell("shutdown.exe -l", 1)

The switch -l performs a log-off.  For more info, type "shutdown /?" from the command prompt.

Rey Obrero (Capricorn1)Commented:
you can design your access application with disabled (X) and File>Exit

How to disable the Close button on the Application window and the Exit command on the File menu


rhfarrisAuthor Commented:
I failed to indicate they were Xing out of the RDC window.  The app requires them to use a close button (X is disabled)
Does anybody know how to create a simple icon to allow that can be used to close the remote desktop connection that you are in.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now