Robot not working unless logged in to machine

I have read all the threads on here and I am still very confused on how to properly run an unattended robot. I am on the latest version of UIPath 20202.2 beta 108. I started with CE, have also just started a trial for enterprise, but we should be able to get 1 unattended robot working with CE so not sure if that makes a difference.

So my test app just takes a screenshot and saves it. I am running it through orchestrator and it is working fine if I have a remote desktop session open on the remote robot machine. If I close that session and run the same job it faults and screenshot object is not available(non ui based actions run fine, but screenshot and clicking, etc not working properly).

I have tried both login to console true and false on the robot settings in orchestrator portal (also set my resolution to be safe). To be honest I don’t think that setting is having any affect at all, theoretically I should see it log me out of my remote session when it is set to true right? But it doesn’t log me out so that leads me to believe its not having any affect. I also set login console(tried true and false) in the UIPath.settings file on the remote robot machine(restarted the uipath agent desktop after changing settings) and still no change in behavior.

What am I missing here? I have spent two days searching through everything on this forum and am no closer to figuring this thing out. Thanks in advance!

1 Like

@brian2
Instead of disconnecting the session, completely log out and see if that works. Although, tbh, if its a console login, it wouldn’t run when session open and active I don’t think. Just a troubleshooting thought.

What does logging say when the robot faults?

Same issue when logging out, yes. Error for saving a screenshot is:

Save Image: Object reference not set to an instance of an object.

–because the screenshot activity failed. also get various mouse click faults if I use a more complicated job not just this screenshot test job. but keeping it simple, I know if I can get the screenshot to work the rest will follow.

I can also add that “simulate click” does work, but that is not a solution for me since it does not work on every program I am trying to automate. It also seems really unreliable, leaves dropdown menus open, doesn’t focus windows, etc. I also tried wrapping the whole program with “Launch workflow interactive” but same behavior.

Hi @brian2

Try this, create a bat file with the following commands;

echo off

tscon %sessionname% /dest:console

Place this on the desktop, and whenever you want to disconnect, simply run as administrator the bat file. This will end your session without locking the workstation, so this could potentially fix the error, the other thing you need to do is to update the Sleep time settings so it doesn’t go to sleep after few minutes

1 Like

Can you confirm that the Robot that you have created is provisioned as an unattended Robot?

The user that is being provided for your robot, is it allowed in the Remote Desktop Connection group of the host machine it is connecting to whether it is explicitly or through a local/security group?

Console vs Interactive Session shouldn’t matter at this point. If you are configured to log into console, it will take over any active session. If you configure it to login interactively whether it connects to an existing session or creates a new session will depend on your local policies of the host.

Where it does matter is if you have it logged in interactively and joins an existing session or you manually join the robot’s session you must keep the session open and not minimized otherwise it will interfer with your automation (You can look at RemoteDesktop_SuppressWhenMinimized in your registry if that is the case).

If you do want to disconnect mid-process then you must return the console output as @Jorge_Rincon suggests.

Can you provide any logging details from Orchestrator and Robot? Both the UiPath logs and Windows Event Application Logs?

1 Like

@Jorge_Rincon you are a life saver! Thank you, logging out with that .bat file did the trick. I can live with this solution for now.

For completeness sake on this thread, @codemonkee yes it is an unattended robot. The user is administrator, same as my login for remote desktop, its the only login the VPS provider gave me.

“If you configure it to login interactively whether it connects to an existing session or creates a new session will depend on your local policies of the host.” Not sure what this means, or if I configured it as an Interactive Session or not. I assusme this means “login to console” set to false in the machine settings on orchestator portal. Local policies of host? Is that just in the uipath.settings file?

To the UIPath team, still very confusing on how to get “login to console” to work properly, maybe need more complete documentation?

As for the suppress when minimized, yes I set that as it was in one of the many threads I found. It definitely helped if you are keeping the connection, my use case is not keeping that open and running completely on VPS with no connection to any other machine.

Thank you all, great support community here and I am continuing on my way now learning and using the product. Cheers.

@brian2,

Glad to hear it worked, this is something that should be available as a resource to download whenever you use Unattended, but anyways good that I was able to help

A bit long winded with the different test scenarios and screenshots. If you are experiencing other outcomes from the below, would love to hear about your use case and could test it out within my own environment if you’re interested!.

My expectation is if you are running a job that connects to a pre-existing session (Console:false) and disconnecting the local session while the process is still running, this will lock the session, this is a security feature of Windows/RDP. I’m not familiar enough, but maybe having a RDS/Terminal server could configure it differently(?)

If you want the process to run its course normally, your options are to keep the RDP session open until the Job is complete or return the session to the console. The later is a security risk as anyone that can access the console physically or virtually will be able to access an unlocked session until the session is secured again by locking it or logging off (which the UiRobot service should do when the job is complete).

That’s correct, my usage of “Interactive Session” is referring to a RDP session that is not logging into the host’s console by setting the Login to Console:False. When thinking of policies that is referring to the Windows Host’s Group Policies, couple examples.

  • Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Connections
    • Restrict Remote Desktop Services users to a single Remote Desktop Services Session
    • Limit number of connections
  • Computer Configuration\Windows Settings\Security Settings\Local Policy\User Rights Assignment
    • Allow log on through Remote Desktop Services

I’m testing this on cloud.uipath.com (20.2.21-release.31) with a Windows 2016 host machine running the UiRobot 2019.10.2 registered as a service within an AWS environment.

The experience below is the same when we were running 2018.3 and testing 2019.10 of both Orchestrator and Robot.
Workflow

  1. Take a full screen screenshot
  2. Record the resolution of the primary screen

Test 1
Out of box, assuming Robot is of type “Unattended” and credentials have been provided, the Robot should be able to connect to a machine/host; by default this will be using the Console which will take over any active sessions of that user kicking the original user off the active session.

image


Test 2
Switching the Robot configuration from Console:true to Console:false, the job will fail if the Robot’s user is not part of a group that allows Remote Desktop Sessions, by default this is the local Administrators and Remote Desktop Users groups.

image

Could not start executor. Rdp connection failed: Message: The connection transport layer failed., Last error: 131085


Test 3
Adding the user into the Remote Desktop Users group, the process will complete successfully.

image


Test 4
Starting a RDP session from my own laptop with a native resolution of 1600x900* and the Robot still configured as Test2/3 (Resolution set to 1900x1200, Console:false). Session is Full sized (not full screen)

*I’m using RDCM, so the local screen resolution is a bit smaller at 1600x823 when at full screen
image

The process runs successfully using the existing session concurrently so I could ‘watch’ it and it used the resolution defined by the initial client/session.

image


Test 5
Same session from Test 4, but this time I’m minimizing the RDP session running a process, bring the RDP session back up and running the process again, followed by disconnecting my laptop session and running the same process.

While minimized the following exception was thrown, followed by 2 successful job when not minimized then disconnected.

Info: Object reference not set to an instance of an object.

image

image


Test 6
Continuation of Test 5, this time I added RemoteDesktop_SuppressWhenMinimized into my laptop’s registry and minimized the RDP session.

image


Test 7
Set Robot back to Console:true, removed Users local group from the Allow log on locally policy.

Logon failure: the user has not been granted the requested logon type at this computer. (Exception from HRESULT: 0x80070569)