Workstation/Remote Desktop Connection Automation

Hi,

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

  try
   {

        Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
        $passname=$passname

        cmdkey /add:$servername /user:$username

        function Connect-RDP {

          param (
            [Parameter(Mandatory=$true)]
            $ComputerName,

            [Parameter(Mandatory=$true)]
            $username,

            [Parameter(Mandatory=$true)]
            $passname
          )

          # 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
              ##[System.Windows.Forms.MessageBox]::Show($Password.GetType().ToString())
              
         
              # 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
          }
        }
        ##[System.Windows.Forms.MessageBox]::Show($servername) 


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


        Start-Sleep -s 10
        ##[System.Windows.Forms.MessageBox]::Show("END") 
        cmdkey /delete:$servername

        ##[System.Windows.Forms.MessageBox]::Show("END") 

        }
        catch
        {
          cmdkey /delete:$servername

        } 

Attached the Xaml Files

Virtual_Machine_Login.zip (13.9 KB)

Regards
Sanjay

Hi sudhev

Do you have any solutions about Challenges 1. Need to do files operations inside RDC(Remote desktop) (Like copy paste files between folders and folder creation in remote desktop)

BestRegards,
Donghai