How to login to RDP Session and run powershell script as admin

Hello all,

I need to login into virtual machine using RDP. Inside RDP session, robot has to run powershell script as admin. Also, need to open and verify computer management inside RDP session. Can anyone help me on this?

Please be noted that I have added Start-Process powershell -Verb runAs line at the start of the powershell script. In studio, it is opening powershell interface as admin and do nothing.

Hi @Sailaja_Pasupuleti

refer the below thread.

additional reference: https://www.youtube.com/watch?v=43rS9rr0Jr0

hope it helps!!!

Hi @Sailaja_Pasupuleti

  1. Use the Hot key activity (Win + R) to open the run command of windows
  2. use a type Into activity to type “mstsc” with “Enter” command to open the remote desktop connection app

Or Simple way In Use Application/ Browser activity indicate the RDP login window

  1. Again use a type Into activity to provide the server name
  2. Do a click event to sign in
  3. On Element Appear activity, check whether the pop up to enter username and password is visible
  4. When appears, use a Type into activity to type your credentials
  5. Again a hot key or a click activity to sign in…

Later on you can use the Invoke Powershell activity for your commands.

Hope this helps :slight_smile:

Thanks for the steps. Can you please help me on How to run user interactive script.

For example,
Do you wish to continue (y/n).

Based on the input, next steps in the script gets executed.

Thanks for the steps. Will implement them.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.