Support > Forums > OpenBots Studio > Agent Connection Configuration

Agent Connection Configuration

TI Distribucion

  • Reporter
  • Calender Icon January 16,2023 at 11:09 PM

Hello,

Hope all is doing well. I have installed the agent on a local server because I need to run the bot in unattended mode from open cloud server. This server is always on and has all the clients needed to connect to our databases, for that reason we installed the agent there.

I access the server from remote desktop and put my active directory credentials in the agent configuration in open cloud server. My problem is that the bot only runs if I have my remote desktop session active.

What do I need to do to be able to run the bot without having my remote desktop session open?

This forum has 314 topics, 681 replies, and was last updated 25 days ago by Support Agent

TI Distribucion

  • Participant
  • Calender Icon January 24,2023 at 7:15 PM

Hello,

Thanks for your response. One Question, in which field i can see the Port number under Execution tab?

Thanks

Nataly Alvarado...

  • Participant
  • Calender Icon January 19,2023 at 9:57 PM

Hi ti-distribucion,

Please check the below settings:

Port number under Execution tab (in Assistant Settings) should match the one in the registry key HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\PortNumber Open Advanced System Setting (App from Windows Search), under Remote tab, ensure a checkbox should be checked to use "Network Level Authentication" for remote connections If above two conditions meet and it still doesn't work, then create the following System Environment Variables and collect the RDP Logs (file) from "%LocalAppData%\OpenBots Inc\Unattended Logs" (directory)

Environment Variables (System):

WLOG_APPENDER=FILE WLOG_FILEAPPENDER_OUTPUT_FILE_NAME=RDP-Logs.txt WLOG_FILEAPPENDER_OUTPUT_FILE_PATH=%localappdata%\OpenBots Inc\Unattended Logs\ (Note: Use Absolute Path to the directory) WLOG_LEVEL=DEBUG

TI Distribucion

  • Participant
  • Calender Icon January 19,2023 at 7:40 PM

This is the log:

2023-01-19 13:33:23.800 -06:00 [INF] Event Name: Long Polling | Log Message: New job notification received for AgentId "ac2796f3-f9a1-48b6-a88f-b925f6b7fbed" 2023-01-19 13:33:23.800 -06:00 [INF] Event Name: Job Fetch | Log Message: Attempt to fetch new Job for AgentId "ac2796f3-f9a1-48b6-a88f-b925f6b7fbed" 2023-01-19 13:33:24.120 -06:00 [INF] Event Name: Job Fetch | Log Message: Job fetched and queued for execution 2023-01-19 13:33:26.099 -06:00 [INF] Event Name: Long Polling | Log Message: Stopped Long Polling 2023-01-19 13:33:26.249 -06:00 [INF] Event Name: Job Execution | Log Message: Job execution started 2023-01-19 13:33:26.249 -06:00 [INF] Event Name: Job Execution | Log Message: Attempt to update Job Status (Pre-execution) 2023-01-19 13:33:26.344 -06:00 [INF] Event Name: Job Execution | Log Message: Attempt to fetch Automation Detail 2023-01-19 13:33:26.344 -06:00 [INF] Event Name: Job Execution | Log Message: Attempt to download/retrieve Automation 2023-01-19 13:33:26.815 -06:00 [INF] Event Name: Job Execution | Log Message: Attempting to install project dependencies 2023-01-19 13:33:26.820 -06:00 [INF] Event Name: Job Execution | Log Message: Attempting to verify project dependencies hash 2023-01-19 13:33:27.040 -06:00 [INF] Event Name: Job Execution | Log Message: Attempt to load project dependencies 2023-01-19 13:33:34.411 -06:00 [INF] Event Name: Job Execution | Log Message: Attempt to execute process 2023-01-19 13:33:34.536 -06:00 [INF] Event Name: GetActiveUserSession | Log Message: Existing active user session found 2023-01-19 13:33:36.441 -06:00 [INF] Event Name: ValidateUser | Log Message: Validate User Account Credentials 2023-01-19 13:33:37.303 -06:00 [INF] Event Name: CreateRDPConnection | Log Message: Start RDP Connection 2023-01-19 13:33:37.303 -06:00 [INF] Event Name: CreateRDPConnection | Log Message: Connecting to RDP Connection 2023-01-19 13:33:37.303 -06:00 [INF] Event Name: CreateRDPConnection | Log Message: Wait for RDP Connection 2023-01-19 13:34:37.631 -06:00 [INF] Event Name: GetActiveUserSession | Log Message: Session not found 2023-01-19 13:34:37.631 -06:00 [ERR] Event Name: Job Execution | Log Message: Error occurred while executing the job; ErrorMessage = System.ComponentModel.Win32Exception (0x80004005): Unable to Create a Remote Desktop Session for provided Credential "DavidOS" at OpenBots.Service.Client.Manager.Execution.Executor.CreateRDPSession(String domainUsername, MachineCredential machineCredential, ServerConnectionSettings serverSettings) at OpenBots.Service.Client.Manager.Execution.Executor.RunAutomation(String commandLine, MachineCredential machineCredential, ServerConnectionSettings serverSettings) at OpenBots.Service.Client.Manager.Execution.ExecutionManager.RunJob(String commandLine, MachineCredential machineCredential) at OpenBots.Service.Client.Manager.Exec

TI Distribucion

  • Participant
  • Calender Icon January 19,2023 at 7:40 PM

Hello Nataly,

Thanks for your response. I tried to follow the steps but still getting the same error.

Nataly Alvarado...

  • Participant
  • Calender Icon January 18,2023 at 4:09 PM

Hi ti-distribucion,

​One thing to keep in mind is that if the session is active, the Agent will simply keep that same user session alive to run the automation (so the AD credentials are not used). Only if the session is closed, the Agent uses the stored AD credentials to create a new session. ​

Please try the below steps on the Agent machine:

  • Ensure AD credentials are correct

  • Disconnect Agent

  • Exit Agent application

  • Restart OpenBotsSvc Service

  • Enable "Always Create New Session" on Agent Execution settings

  • Reconnect Agent

  • Log off from Agent machine

Try running a new job after following these steps. Also, please share the Agent logs found in this location for further troubleshooting: C:\Users%USER%\AppData\Local\OpenBots Inc\OpenBots Agent\Logs\Agent Logs

TI Distribucion

  • Participant
  • Calender Icon January 18,2023 at 12:45 PM

Hi Nataly,

Thanks for your response. I already cheked the agent connection and it's active. But, i am getting the following error when i try to run an automation when the Remote Deskptop session is inactive:

Unable to Create a Remote Desktop Session for provided Credential "DavidOS"

I am using my active Directory Credentials to access the server through remote desktop.

Nevertheless, if i have an open session(active or minimized) the job ends without errors.

Nataly Alvarado...

  • Participant
  • Calender Icon January 17,2023 at 9:42 PM

Hi ti-distribucion,

To run an unattended automation, please make sure the Agent specified in the schedule has an active connection. Once an Agent is connected, it will use the linked Active Directory credentials to create the Remote Desktop session in the locked machine. Please ensure the linked credentials are correct, and that the specified user is not currently connected in a session (active or minimized).

Also, you can ensure a new session is always created by setting the Agent configuration "Always Create New Session" to true"

Please let us know if this helps ​ Thanks!

You are not authorized to reply, please click here to login and add your reply to this topic.