Using tscon to run UI automation remotely without a Remote Desktop Connection

Once of the challenges in running RPA Express remotely is that you lose your ability to perform UI (and some keyboard) interactions the minute you log off of a Remote Desktop Connection. I’ve been looking for an answer to this issue–including following multiple posts here–but haven’t been able to find one. Then I mentioned the issue to a friend of mine who is a QA Automation Engineer and asked me why I wasn’t using tscon.

tscon (C:\Windows\System32\tscon.exe) has multiple uses, but in this case it’s a windows system utility that you can use to transfer your remote desktop session to the host console. QA testers use it to run automation scripts ‘in the dark’. Based on my initial testing, it seems to work equally well in the same scenario for RPA Express. You can find the Microsoft guidance here:

There’s also a good writeup on Stack Overflow on how to find your session information and use tscon to transfer your RDC session to the console, here:

Caveat: this approach does leave the remote computer in an unlocked state. Depending on your security situation and hardware implementation, this may be an issue. I’m running on VMs in an otherwise highly secure environment so it’s less of an issue.

1 Like

@sbeauchem thanks for sharing :+1:

1 Like

@gerhardus_meyer maybe something for us?

look promising…

1 Like

@sbeauchem it works good, but OCR does not work in my environment, did you have this issue?

@sbeauchem thanks for this tip. Tried this one and was able to transfer the session to the host console. However the keyboard and UI actions still seemed to fail. I am running Windows 2016 Server as the host.

Seems the only viable option is to leave RDC session open and lock the screen of the machine one uses to access the remote host.

Hey @peke_robot. I also have learned in the interim that this is NOT a full-scope solution. I too kept coming across UI action failures.

In the interim, I have identified a console solution that has been 99% reliable on UI actions. A company called SolarWinds has a tool called ‘Mini Remote Control’–a remote desktop application. It’s unique from TSCON and other remote desktop solutions I’ve found in that it creates a virtual display on the remote computer. This virtual display remains active even when the remote session is disconnected, meaning that UI actions have a screen on which they can be performed.

It’s not freeware, but it was well worth the cost to solve this issue once and for all. It also comes with a trial period, so you can validate against any specific UI actions you’re performing.

2 Likes

Thanks for the tip. I will definitely try this. The issue with the TSCON session transfer solution is related to Win Server versions. That worked with Server 2008 and earlier but not with the more recent ones. But as said this SolarWinds is good tip and will try that!

2 Likes