RDP Session ending after 2 hours

Hello everyone,

I’m currently facing a problem that when one of my processes that is running in an RDP session gets shut down because the session locks after exactly 2 hours. Keep in mind that this process takes an average of 9 hours to be complete.

Does anyone ever faced this issue? If so how did you overcame it?

Best regards,
Rodrigo

Hi @rodrigo.simao
can you please try with below settings in your RDP PC.

To prevent the screen from turning off automatically, use these steps:

  1. Open Settings on Windows 10 .
  2. Click on System.
  3. Click on Power & Sleep.
  4. Under the “Power & sleep” section, use the “On battery, turn off after” drop-down menu and select the Never option.

additionally in UiPath you can use simulate click enabled in your all click activity.

Hello @Baskar_Gurumoorthy, those setting are already what I have but thank you for your time!

have you tried on running the bat files. Refer the below thread.

Are you logging into the server via RDP then starting the job as attended? That’s not correct. If you want it to run without human interaction you should be running it as unattended so that Orchestrator/Robot establish their own RDP session.

That’s what I’m doing, this is an unattended robot.

Have you logged into the server with RDP using the robot account, and then just closed the RDP window? Don’t do that. Any time you log in with a robot account you must SIGN OUT.

Try logging into the server via RDP with the robot account, then SIGN OUT from the start menu. Now run the unattended job. It should no longer lock.

1 Like

I’ll try that and then I’ll get back to you. thank you for your time!

maxIdleTime: (Default: 0) Seconds a Connection can remain pooled but unused before being discarded. Zero means idle connections never expire.

It seems that at HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Terminal Services the value for MaxIdleTime was set to 7200000 (120 minutes).
So basically, the limit for active but idle Remote Desktop Services sessions is set to 120 minutes, and you will receive in advance a 2-minute popup reminder with the Idle timer expired : Session has been idle over its time limit and after that the RDP session will be forcibly disconnected and if you have a long running job using UiPath, the job will fail with Job stopped with an unexpected exit code: 0x40010004 .

So either you set that value to 0 to never expire, or you are adding a value more that 2 hours.
After performing that, the machine needs to be restarted to apply the change.

Doesn’t a running job stop Windows from timing out? We have jobs that run longer than 2 hours and have never had this issue - I suspect it’s just that they’ve logged in via RDP and then closed the RDP window instead of signing out. I wouldn’t go changing registry keys without signing out first and then testing.

No.

If you have a policy configured in Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Session Time Limits\End session when time limits are reached. or a value in registry that has that maxIdleTime in place, it will not take into account that you have something that is running in your machine. It will only display that popup and it will disconnect.

If you don’t have that issue, that means either you don’t have a policy for that, or the value of maxIdleTime is set to default value which is 0.

Ok that would be useful to include - that it’s not a default for that key to exist - in your explanation. Thanks!

ask you it team to change default timeout to never

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.