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?
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.
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.
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.
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.