How to circumvent a GPO update of the ConnectionString in the UiPath.Settings File

How to automatically provide the Robot connection string to VDI installations, through GPO?

Issue Description:

  1. An image is used to create all (Dev, UAT, Prod) VDIs.
  2. UiPath is installed with the parameter "ConnectionString" pointing to the dev environment.
  3. On Production VDIs, the config file is updated to "C:\ProgramData\UiPath\UiPath.settings" (before Windows boots up) to point to the Production Orchestrator. This is the basic Group Policy Object (GPO) policy.
  4. The local policy prevents writing directly to the file in the ProgramData folder.

When GPO is updated as below, the config file successfully changes (see ui001paprod.... below):


But less than a minute later, ConnectionString having ui001paprod is restored to the original ConnectionString having ui001padev. (See Below):



Resolution:

Create a PowerShell script to disconnect:
  • UiRobot.exe disconnect

Then connect using the new ConnectionString.

Machine Key example:

  • UiRobot.exe connect --url https://ui001paprod.demo.uipath.com/ --key 1122AAB3C-DD44-ABCD-1234-7788GG99HH00 --connectionString

Client ID and Client Secret example:

  • UiRobot.exe connect --url https://ui001paprod.demo.uipath.com/ --clientID 696CCA0C-1234-ABCD-1234-F65BBC2F15DE --clientSecret QJX!jv12345A4q4N --connectionString