Got a small problem.
We have a internet-facing VPN from Netgear, to allow staff and teachers to access the school network using RDC from their home.
They login to the VPN using their web browser, click on one of our remote servers and they are RDC'ed in.
People though have a massive issue, with logging off. It seems to escape their head. All users are doing is clicking the Close button on the RDC Client, Which is not logging them off.
We are building a program to sort this out, The idea is to "hook" into the Remote Desktop API and then check if a session is disconnected, if it is, we log off the user.
The program would be running in the background as a service or a physical minimized EXE.
We are building this in C#. So does anyone know of any RDC Events that can be called using .NET 4? Ones that will allow us to know when the user is closing the session.
If you need anymore information on this, let me know.
Cheers
On your local Windows PC: In the search box on the taskbar, type Remote Desktop Connection, and then select Remote Desktop Connection. In Remote Desktop Connection, type the name of the PC you want to connect to (from Step 1), and then select Connect.
On Windows OS, Remote Desktop Connection (RDC) is built-in by default, allowing users to customize their file/folder sharing settings before connecting. From there, users can easily transfer files over RDP.
Remote Desktop Connection (RDC) is a Microsoft technology that allows a local computer to connect to and control a remote PC over a network or the Internet. It is done through a Remote Desktop Service (RDS) or a terminal service that uses the company's proprietary Remote Desktop Protocol (RDP).
Got it.
Call
SystemEvents.SessionSwitch += new SessionSwitchEventHandle SystemEvents_SessionSwitch);
Then
static void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
{
if (e.Reason == SessionSwitchReason.RemoteDisconnect || e.Reason == SessionSwitchReason.ConsoleDisconnect)
{
// Log off the user...
}
else
{
// Physical Logon
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With