Automatic job fail when I running unattended bot when working minimizing or close Remote Desktop ( But working fine when maximize remote desktop)

As you mentioned this and no one has addressed this aspect yet, I bolded the two that likely apply to your scenario.


I did some testing on this a while back which can be read here

Short summary

  • RDP in Console mode will connect to the remote host on Session 0 (typically this will be 800x600 or 1024x768)

  • RDP in Interactive (Console: False) behaviour will depend on on your remote hosts Policies / Configurations. Which can be configured to only allow one session per credential, so any new session will take over an existing session if it exists, or it could be configured to allow multiple sessions for the same credential/profile. See above link for resolution test scenarios

  • RDP by default will suppress the UI essentially virtually locking the screen if you minimize the RDP Window (Look up RemoteDesktop_SuppressWhenMinimized or see Robot - Executing Tasks in a Minimized RDP Window)

  • Closing the RDP Window/Session will by default lock the session interfering in a similar way to minimizing the window. In order to work around this you need to either A) Leave the Window open until the Job is complete B) Send the Session to the Console by issuing the command tscon %sessionname% /dest:console. B isn’t ideal from a security perspective as you are leaving the console session unlocked and vulnerable to someone that physically gains access to the host or the console view in the VM Controller.

As noted, there wouldn’t be an issue taking over an existing session if you didn’t logout, but it’s always nice to ensure you start from a fresh session or if nothing else to free up memory. This is something I do frequently during Development, Testing, or I want to observe the job in real-time in production, it’s not recommended, but if you are connecting to the session simultaneously you should definitely perform some tests of your own to become familiar with the nuances and issues you can run into.