# Working with RDP

The Sherpa RPA platform allows for the automation of applications running in virtualization environments and Remote Desktop Protocol (RDP) access windows – both in full-screen and windowed mode (single application mode in a window).

## Installing Sherpa RPA Runtime

On the RDP server to which the connection will be made, it is necessary to install SherpaRPARuntime.exe in Attended mode following the instructions below:

{% embed url="<https://docs.sherparpa.ru/sherpa-orchestrator/razvertyvanie-platformy-pod-upravleniem-orkestratora/ustanovka-sherpa-rpa-runtime>" %}

After the installation is complete, it is recommended to restart the server.

## Installing the Native RDP Plugin

On the client computer from which the connection to RDP will be made, it is necessary to install the Sherpa Native RDP Plugin following the instructions below:

{% embed url="<https://docs.sherparpa.ru/sherpa-robot-i-sherpa-assistant/rabota-v-sherpa-assistant/kontekstnoe-menyu-sherpa-assistant/plaginy/ustanovka-plagina-native-rdp>" %}

## Connecting and Working with RDP

After installing the necessary components, you can start working with applications launched via RDP. To do this:

* On the local computer, launch Sherpa Robot.
* Use the action recording tool to work with RDP windows. All interface elements will be highlighted, and selectors will be recorded as usual.
* The recorded selector will contain the RDP parameter in the first line, allowing it to be identified as an element located in the RDP environment.

## Using Sherpa Designer Blocks for Working with RDP

In the "Remote Desktop RDP/Citrix" block palette of Sherpa Designer, special blocks for working with RDP / Citrix are available.

{% embed url="<https://docs.sherparpa.ru/sherpa-designer/spravochnik-blokov/udalennyi-rabochii-stol-rdp-citrix>" %}

These blocks allow you to perform actions within application windows launched via RDP.

Depending on the RDP configuration, some universal blocks, such as "Create Connection" or "Connect to Session," may work with RDP connections but not with Citrix connections. In this case, to launch a custom RDP session, use the Robot to simulate one of the typical User actions according to the RDP operation manual deployed in the specific environment:

* action to launch the RDP session;
* action to launch the target application within the RDP session.

Once the connection to the RDP application is established in the standard way, the Robot will automatically be able to perform actions in the RDP windows on the screen.

## Licensing Components

The Sherpa RPA Runtime plugin running on the RDP side is not considered a standalone Robot and does not require a separate License for its operation. To successfully automate applications via RDP, a valid License for Sherpa RPA is required only on the client Robot side.

## Usage Examples

Sherpa Robots can perform various tasks in the RDP environment, such as:

* Automating data entry into applications;
* Processing documents and files;
* Performing routine operations, such as clicking on interface elements and entering text.

Working with Sherpa RPA in the RDP environment requires following certain installation and configuration steps; however, after that, the automation process becomes simple and efficient.

Any type of Robot can be installed on the local computer:

* Sherpa Designer + Attended Robot,
* Sherpa Attended Robot,
* Sherpa Unattended Robot.

The Robot script will be launched and executed from the local computer.

> It is recommended to install plugins under an administrator account (after which further work does not require administrator rights).

After configuration, the Robot on the client side is capable of recording and replaying actions using selectors in windows opened via RDP.

More about working with selectors:

{% embed url="<https://docs.sherparpa.ru/sherpa-designer/rabota-v-sherpa-designer/paneli-svoistv-i-peremennykh-i-rabota-s-nimi/panel-svoistv/nastroika-selektorov>" %}

## Features of RDP Session Operation

When you disconnect the RDP session using the close button, the graphical context of Windows, along with the User interface, ceases to exist. As a result, Robots based on visual scenarios and GUI elements stop working.

An alternative is:

* Disconnecting RDP using a special file that can be run with administrator rights to exit RDP without fully disconnecting the session. For this, on the remote machine, you need to run the file located in the Robot distribution: `closerdpsession.exe`. However, this is only a "workaround," and you need to test the operation of robots under such conditions in advance, as there are no guarantees.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeT09qKrboPscjub0O7eid0oPD0Lhf37S_CVtGPR-CDE78rVgLiq5GWRhuoqZz--qxjo6f8USa33BsZ03V5WPoeZDsG24IF8C8Vvlecl9_2AuiqkuFWsSRfVnxJM8cL1hpuSbUEPw?key=o_zVuYPLecebuklluw-DjQ" alt=""><figcaption></figcaption></figure>

* Configuring the Windows registry, which allows the visual context not to be disconnected when minimizing the window of the working session. For this, you need to manually find and check the parameter: `RemoteDesktop_SuppressWhenMinimized` in the Windows registry.\
  The installer automatically creates this parameter and assigns it a value of `2`. However, sometimes access to the registry may be blocked by group policies, and then you need to create this parameter yourself under the keys: `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Terminal Server Client Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Terminal Server Client`\
  Parameter: `[DWORD] RemoteDesktop_SuppressWhenMinimized = 2`
* Disconnecting RDP using the keyboard shortcut SHIFT+F4.
* Using the Robot menu item "Disconnect from Current RDP Session."

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdGQtdGd1kXpxj0aOvhg8wdfjsijSEoImVHRuqgMemiktxSvHfB7_BUfYDtv0k2pl1rSzut3Aey7Xxm0UESXEdh8B5eDztk8fBpUhRtxywprHau3--BlFK1W79qyIjBaADE5Ri93A?key=o_zVuYPLecebuklluw-DjQ" alt=""><figcaption></figcaption></figure>

Also, when connection errors occur, it is important to check the settings of IP addresses, logins, passwords, and the ability to establish a stable connection to the target machines.

The number of parallel RDP sessions in the system is limited by the capabilities of the operating system. Without installing the RDS (Remote Desktop Services) role, the maximum is two simultaneous sessions.

It is important to note that Robots launched outside the client's boundaries or on the server must have appropriate rights and settings. It is also possible to install multiple Robots under different accounts on one server.

Additionally, the Orchestrator has implemented the ability to manage the state of Robots, for example, temporarily disabling them during maintenance. In the "Robots" section, there are switches to activate/deactivate Robots during servicing or updates. When disconnected via the Orchestrator, the Robot will not receive new Tasks, but the RDP session in the system will remain, allowing for reconnection later to check the Robot's status.

## Video

An example of remotely launching a Robot script and transferring files is presented in the following video:

{% embed url="<https://sherparpa.ru/ucontent/?8fxu>" %}
