Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I start remote desktop from PowerShell?

How do I start an RDP session from powershell? I'm looking to avoid a custom script because I work at an MSP and end up remoting into machines across various domains in a day and so maintaining a selection of scripts across each is not trivial (unless you have a solution to that for me).

like image 942
Josiah Avatar asked Jun 30 '14 15:06

Josiah


2 Answers

Same as in command line, you can launch the RDP client as so:

mstsc /v:10.10.10.10:3389
like image 158
Raf Avatar answered Sep 28 '22 06:09

Raf


From your desktop, you can start an RDP session pointing to a remote system with this:

Start-Process "$env:windir\system32\mstsc.exe" -ArgumentList "/v:$machinename"

Where $machinename is the name of the remote system. You will be prompted for credentials.

like image 32
alroc Avatar answered Sep 28 '22 06:09

alroc