In the app you have connect / disconnect but no logoff?
Is this intentional?
Mike
Best Answer
S
Stefan Koell
said
about 6 years ago
Like Patrik mentioned, the remote desktop protocol itself does not support logging off a session. The way MobaXTerm, RDCM, etc. are doing it, is to "reset" the session using the WTS API. There are a couple of issues with this approach:
* it's error prone because in many situations you can use RDP (port 3389) but can't use the WTS API because all high ports (RPC) are basically needed
* it's dangerous because resetting the session is not exactly a log off. It's basically killing the session and unsaved data is lost
* it's fragile because there is not much to identify the correct session. In the WTS API you need to specify the session id you want to kill. Identifying the session by the username/client alone can sometimes lead to the wrong session
You can still use the dashboard tab to reset sessions though.
I assume you're referring to the RDP connection type, right? In this case unfortunately logoff is not possible, as - from our current knowledge - there is no official "logoff" support within the RDP protocol available. Sorry!
Regards,
Patrik
R
Rob Nix
said
about 6 years ago
Patrik,
How does MobaXterm do it? They have a menu selection that will logoff and close all open RDP Sessions.
J
Jose
said
about 6 years ago
This is surprising to me too. I have this option in Microsoft's Remote Desktop Connection Manager.
Stefan Koell
said
about 6 years ago
Answer
Like Patrik mentioned, the remote desktop protocol itself does not support logging off a session. The way MobaXTerm, RDCM, etc. are doing it, is to "reset" the session using the WTS API. There are a couple of issues with this approach:
* it's error prone because in many situations you can use RDP (port 3389) but can't use the WTS API because all high ports (RPC) are basically needed
* it's dangerous because resetting the session is not exactly a log off. It's basically killing the session and unsaved data is lost
* it's fragile because there is not much to identify the correct session. In the WTS API you need to specify the session id you want to kill. Identifying the session by the username/client alone can sometimes lead to the wrong session
You can still use the dashboard tab to reset sessions though.
A
Andrew Williams
said
over 4 years ago
I'm still stunned that logoff isn't an option in what is otherwise a very robust package. The WTS API provides the WTSLogoffSession command - can't that be used? Can you provide a means for us to send commands to the remote session, such as CMD.EXE logoff ? I've tried playing with commands and key sequences but they all seem to run in the local computer and not the remote session.
Stefan Koell
said
over 4 years ago
Hi Andrew,
the dashboard allows you to reset the session (note that unsaved data is lost). The reset button invokes the WTSLogoffSession API. So you can use the dashboard to do that. However, using this API to log off the very same session use in Royal TS is tricky. The WTSLogoffSession requires a session id to identify the session you want to reset/logoff. When you connect to the RDP session using the Microsoft RDP ActiveX control we use in Royal TS, you cannot get the session id. So you need to match the user, computer name to match the session and depending on the terminal service setup, it's possible that this doesn't match the correct session. So it's quite dangerous to do this "automatically" with the information at hand.
Unfortunately there's still no API to send commands through the RDP session - which would be a fantastic feature. I reported this to MS several times in the past years but they never listened :(
Mike roberts
Like Patrik mentioned, the remote desktop protocol itself does not support logging off a session. The way MobaXTerm, RDCM, etc. are doing it, is to "reset" the session using the WTS API. There are a couple of issues with this approach:
* it's error prone because in many situations you can use RDP (port 3389) but can't use the WTS API because all high ports (RPC) are basically needed
* it's dangerous because resetting the session is not exactly a log off. It's basically killing the session and unsaved data is lost
* it's fragile because there is not much to identify the correct session. In the WTS API you need to specify the session id you want to kill. Identifying the session by the username/client alone can sometimes lead to the wrong session
You can still use the dashboard tab to reset sessions though.
- Oldest First
- Popular
- Newest First
Sorted by PopularPatrik Kernstock (Archived)
Hi Mike!
I assume you're referring to the RDP connection type, right? In this case unfortunately logoff is not possible, as - from our current knowledge - there is no official "logoff" support within the RDP protocol available. Sorry!
Regards,
Patrik
Rob Nix
Patrik,
How does MobaXterm do it? They have a menu selection that will logoff and close all open RDP Sessions.
Jose
This is surprising to me too. I have this option in Microsoft's Remote Desktop Connection Manager.
Stefan Koell
Like Patrik mentioned, the remote desktop protocol itself does not support logging off a session. The way MobaXTerm, RDCM, etc. are doing it, is to "reset" the session using the WTS API. There are a couple of issues with this approach:
* it's error prone because in many situations you can use RDP (port 3389) but can't use the WTS API because all high ports (RPC) are basically needed
* it's dangerous because resetting the session is not exactly a log off. It's basically killing the session and unsaved data is lost
* it's fragile because there is not much to identify the correct session. In the WTS API you need to specify the session id you want to kill. Identifying the session by the username/client alone can sometimes lead to the wrong session
You can still use the dashboard tab to reset sessions though.
Andrew Williams
I'm still stunned that logoff isn't an option in what is otherwise a very robust package. The WTS API provides the WTSLogoffSession command - can't that be used? Can you provide a means for us to send commands to the remote session, such as CMD.EXE logoff ? I've tried playing with commands and key sequences but they all seem to run in the local computer and not the remote session.
Stefan Koell
Hi Andrew,
the dashboard allows you to reset the session (note that unsaved data is lost). The reset button invokes the WTSLogoffSession API. So you can use the dashboard to do that. However, using this API to log off the very same session use in Royal TS is tricky. The WTSLogoffSession requires a session id to identify the session you want to reset/logoff. When you connect to the RDP session using the Microsoft RDP ActiveX control we use in Royal TS, you cannot get the session id. So you need to match the user, computer name to match the session and depending on the terminal service setup, it's possible that this doesn't match the correct session. So it's quite dangerous to do this "automatically" with the information at hand.
Unfortunately there's still no API to send commands through the RDP session - which would be a fantastic feature. I reported this to MS several times in the past years but they never listened :(
Regards,
Stefan
-
What happened to the forum?
-
About this Forum
-
Security Information
-
Supported Secure Gateway (SSH) ciphers
-
Why is no remote file browser in SCP available?
-
What encryption is used in the rtsz files when enabled?
-
Royal TS V4 License File
-
How to resolve RDP resolution issues in Windows 7 with high resolution screen
-
Auto Fill in web page connection
-
How to reference custom properties in tasks and templates?
See all 276 topics