Workstation/Remote Desktop Connection Automation


From a local Machine , I have to connect to RDC(Remote desktop) (X.X.X.X) and perform the below tasks listed.
Challenges :

  1. Need to do files operations inside RDC(Remote desktop) (Like copy paste files between folders and folder creation in remote desktop)

  2. We have MS Access Database inside RDP and it has to run 10+ queries inside the RDP(Remote desktop). We cannot move the database from RDP to anywhere due to other dependencies.

3)Excel:- Once the database query run completed need to below mentioned excel validations in the Remote Workstation Pivot refresh, data validation, Cell Coloring

Looking forward for your help and support in this regard

1 Like

Hi @sudhev ,

Connecting to RDP You can Use the Below PS Script and inject in uipath with Activity Invoke PowerShell.

Below Is the Script


        Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted

        cmdkey /add:$servername /user:$username

        function Connect-RDP {

          param (



          # take each computername and process it individually
          $ComputerName | ForEach-Object {

            # if the user has submitted a credential, store it
            # safely using cmdkey.exe for the given connection

              # extract username and password from credential
              $User = $username
              $Password = $passname
              # save information using cmdkey.exe
              cmdkey.exe /generic:$_ /user:$User /pass:$Password
            # initiate the RDP connection
            # connection will automatically use cached credentials
            # if there are no cached credentials, you will have to log on
            # manually, so on first use, make sure you use -Credential to submit
            # logon credential

            mstsc.exe /v $_ /f

        #Connect-RDP -ComputerName $servername -username $username -Password 
        Connect-RDP -ComputerName $servername -username $username -passname $passname

        Start-Sleep -s 10
        cmdkey /delete:$servername


          cmdkey /delete:$servername


Attached the Xaml Files (13.9 KB)