Hi guys,
I would like to run tscon on the remote host before disconnecting the RDP session.
What would be in your opinion the best way to send a "tscon%sessionname% /dest:console" before disconnecting?
Thank you
Rafael
Hello,
In the properties of your RDP session under the "Events" tab you will have the "Before Disconnect" settings that will allow you to run a command/script before disconnecting
Best regards,
Zacharia Ellaham
2017-06-07_8-22-44.png
Hi @Zacahria,
Thank for your update. The "Before Disconnect" event is triggered on the target machine or local?
I've tested on my side and it seems it's a local event.
Thank you
Rafael
Hello,
Did you try with another command or is it only this one that cause an issue ?
Best regards,
Zacharia Ellaham
I've only tried with tscon
Hello,
Could you please test other command because it is supposed to execute the command on the remote computer.
Best regards,
Zacharia Ellaham
With tscon RDM opens an explorer folder pointing to c:\windows\system32. If I try with notepad.exe, it's opening notepad on my local machine.
I would like to run tscon on the remote machine before login off. Is that possible?
Hello,
Could you please create a command line entry (located in the macro/script/tool section) and use for your before Disconnect instead of directly typing your command there.
Also please note that the "Commands" in Before Disconnect will always be run on the local machine my apology for the mistake
Best regards,
Zacharia Ellaham
2.png
1.png
Hi Zacahria,
I've tested two different command line entries as you can see from the attached images.
After adding them to the "Before disconnect" event, on both I get the following error message: "Unable to execute application!: "tscon.exe"
Regards,
Rafael
2.JPG
1.JPG
Hello,
Could you please tell me what you would like to achieve with the TSCON command ?
Best regards.
Zacharia Ellaham
Hi Zacahria,
When we connect to a remote machine with rdm the console session get's locked for the user who was connected via KVM. When I disconnect the remote session via rdm the console session will remain locked for that user. What I want to do is to reconnect the console session (kvm) when closing my rdm session. This is possible via tscon, I don't know if there is any other way to accomplish this?
Rafael
Hello,
Could you please try to set this option to false in the properties of your RDP sessions
I think that this should work for you sir.
Best regards,
Zacharia Ellaham
542.png
Hi,
With that option enabled, when I disconnect from RDM the local (KVM) console session keeps locked.
Rafael
Hello,
We did a lot of testing on our side and I am afraid that even do we could not get it working in embedded mode.
Did you managed to get this functionality working with Microsoft native RDP on your side ?
Best regards,
Zacharia Ellaham
Hi,
Currently, we need to create a shortcut on each target machine to run "tscon %sessionname% /dest:console". This is really painful because we need to create this shortcut on each machine and for this to work we need to disconnect the RDP session from this shortcut and not from RDM.
Rafael
Hello Rafael,
I have made some verifications/testing and the method described in your latest reply is the one to do.
https://techjourney.net/remote-desktop-connection-without-locking-remote-computer-session-on-disconnect/
Unfortunately, it's not possible to run this command from RDM prior to the disconnect of the session. Sorry about that.
The way you are doing it actually is the proper one.
Best regards,
Jeff Dagenais
Hi Jeff,
Thank you for your update.
I've been digging around and I was seeing if it would be possible to execute tscon from RDM Agent? Would this approach make any sense? If so, could I run an agent script on the "before disconnect" event?
Hello,
It's possible to send a command to the remote server using RDM Agent yes. It will do the same thing as your shortcut on the remote server, except that you will launch it from RDM instead that from the remote session.
However, it's not possible to run the agent via the Before Disconnect event.
Best regards,
Jeff Dagenais
This thread is 5 years old. I'm facing the same issue today. Trying to run tscon Before Disconnect? Have you made this possible in the meantime?
Hello Michael,
After reading through this old thread, I have to confirm that the same thing still applies to the latest version of the product. You would need to create a shortcut on your machine to accomplish what was mentioned by Raphael, it is not possible to use the RDM Agent in the "Before Disconnect" event (now called the "Before Close").
Sorry for the inconvenience.
Best regards,
James Lafleur
Hello James,
thanks for your investigation - now I have certainty :-)
Yours Michael