By Ellie / Last Updated April 25, 2023

 

Can I connect to remote computer PowerShell?

Hi, everyone! Is it possible to use connect to a remote computer PowerShell and manage it with my local device? Can you tell me the detailed process? Please accept my heartfelt gratitude in advance!

- Question from Tina

PowerShell Logo

How-to guide: Connect to remote computer PowerShell

It's well-known that Windows Remote Desktop allows a computer to be accessed by Remote Desktop Connection (MSTSC). Actually, you can also use PowerShell Remoting to connect to a remote server and manage it. Before that, you should enable PowerShell Remoting on the computer to which you want to connect by following the steps below:

Step 1. On Windows 11/10, press Windows + X, and choose PowerShell (Admin) from the menu.

Powershell

Step 2. In the PowerShell window, input the following command and hit Enter.

♦ Enable-PSRemoting -Force

PowerShell Enable PSRemoting

PowerShell: Connect to remote computer with Credentials

You can start a remote session with PowerShell and then execute commands on the remote computer from your local device. See the detailed steps:

Step 1. On the local computer, run PowerShell as administrator.

Step 2. Enter the following command and hit Enter.

♦ Enter-PSSession -ComputerName COMPUTER -Credential USER

► Note: COMPUTER refers to the computer name or the IP address of the remote computer that you want to access; USER refers to the username of an account on remote computer.

Step 3. In the pop-up window, input the password of the account and click OK.

Windows PowerShell Credential Request

PowerShell: Execute a single command on remote computer

If you just need to run a command on the remote computer, refer to the steps:

Step 1. Run PowerShell as administrator.

Step 2. Run the command below and hit Enter.

♦ Invoke-Command -ComputerName COMPUTER -ScriptBlock { COMMAND } -credential USERNAME

► Note: COMPUTER is the remote PC’s IP address or computer name; COMMAND refers to the command that you want to run on the remote computer; USERNAME refers to the username of an account on the remote computer.

Step 3. In the pop-up window, input the password of the account and click OK.

PowerShell: Run Remote Desktop Connection to access remtoe PC

You can also choose to run Remote Desktop Connection to access and control the remote desktop from PowerShell. What you need to pay attention to is that this requires you to enable Remote Desktop on the remote computer in advance.

Step 1. Run PowerShell as Administrator.

Step 2. Run either one of the following two commands:

♦ mstsc /v:[IP address of the remote PC]:3389

♦ Start-Process "$env:windir\system32\mstsc.exe" -ArgumentList "/v:$[the computer name of the remote computer]"

MSTSC Server

Step 3. Now, input the username & password of the account that you want to log in to on the remote computer. After a while, you can see the desktop of the remote PC and use it.

AnyViewer: Empower you with stable and secure remote access 

Now, you must know how to connect to a remote computer Powershell, run a PowerShell command on a remote PC, or launch RDC from PowerShell to access the remote PC. The precondition of those operations is that the remote computer and the local device should be on the same network. If not, you need to complete extra work, which can involve network and router configuration and are complicated to operate. Sometimes, errors like connecting to the remote server failed occur, and you can't connect to a remote computer with PowerShell. 

Here an overall, stable, and secure remote desktop software, AnyViewer is recommended. It enables you to connect to remote computers over the same LAN or from a different network and execute kinds of operations, including running PowerShell commands. Free download it and see how it works.

Download Freeware Win 11/10/8.1/8/7/Server
Secure Download

 

► AnyViewer supports you to access Windows PC from Android or iOS device. To access computer from phone, you need to download AnyViewer mobile app from Google Play or App Store. 

Step 1. Install and run AnyViewer on the to-be-accessed computer. Create an AnyViewer account and log into it on both devices. 

Free Editions

Step 2. On your local machine, go to Devices, locate the remote computer, and click One-click control.  Immediately, you can take full control of the remote computer. 

Devices

✍ Tips:
✐ If you want to offer one-time remote support to your clients or customers, input the Device id of the remote computer, click Connect, send a request control, and wait for access approval from your partner. 
✐ AnyViewer also offers advanced plans, which enable users to manage more devices, control more computers at the same time, and with advanced features, like accessing in privacy mode. 

Conclusion

It's not easy enough to connect to remote computer PowerShell and run commands on the remote machine.  To get a quick and fantastic remote access experience, it's recommended you switch to AnyViewer. During the remote session, you can transfer files, change the resolution, hide wallpaper, and so on.