Error: "Cannot bring the target application in foreground because the Windows session is locked".
Issue: Robot receiving this error:
- Cannot bring the target application in foreground because the Windows session is locked.
Resolution #1
Ensure Set time limit for active but idle Remote Desktop Services sessions policy is set to Not Configured or Disabled.
- Press Windows+R on your keyboard to open the “Run” window.
- Type gpedit.msc, and then hit Enter or click “OK.”
- Navigate to: Administrative Templates \ Windows components \ Remote desktop services \ Remote desktop session host \ Session Time Limits\ Set time limit for active but idle Remote Desktop Services sessions
Resolution #2
Ensure Enable news and interests on the taskbar policy is set to Not Configured or Disabled.
- Press Windows+R on your keyboard to open the “Run” window.
- Type gpedit.msc, and then hit Enter or click “OK.”
- Navigate to Computer Configuration > Administrative Templates > Windows Components > News and interests > Enable news and interests on the taskbar
Resolution #3
Ensure Sign-in and lock last interactive user automatically after a restart policy is set to Not Configured or Disabled.
- Press Windows+R on your keyboard to open the “Run” window.
- Type gpedit.msc, and then hit Enter or click “OK.”
- Computer Configuration > Administrative Templates > Windows Components > Windows Logon Options > Sign-in and lock last interactive user automatically after a restart
If the issue persists, then:
- Navigate to Administrative Templates \ Windows components \ Remote desktop services \ Remote desktop session host \ Connections
- Right-click Connections folder in left pane
- Select Export List...
- Save to .txt file.
Perform below steps also,
- Navigate to Administrative Templates \ Windows components \ Remote desktop services \ Remote desktop session host \ Session Time Limits
- Right-click Session Time Limits folder in left pane
- Select Export List...
- Save to .txt file.
Send the two .txt files to UiPath Product Support for further analysis.