How to run PowerShell on a remote PC

Remote desktop applications are often used fairly extensively in business environments. In other more “at home” environments, remote connection tools allow us to access other devices without having to be in front of the computer screen.

Of course, these types of utilities always usually have a lot of layers of security, since let’s face it: there is nothing more dangerous than being able to operate a PC or a mobile phone remotely. In the case of PowerShell , these layers of security translate into granting certain permissions for Windows to allow these types of activities.

How to launch PowerShell commands remotely from another computer

Before you start, you might want to take a look at some of the best remote desktop apps for Android . If all you want is to perform some simple action on the remote PC, maybe this will be enough.

If what you need is a little more versatility and a terminal window that allows you to execute commands from another PC, then you will have to do the following.

Enable PowerShell on the target PC

WARNING: Bear in mind that for a Windows PC to receive Powershell commands remotely, we must first perform some actions on the target PC .

  • Open Powershell on the target PC with administrator permissions. Note: You can run PowerShell by typing “powershell” in Windows browser and selecting the “Run as administrator” option. You can also find the executable file in the path C: \ Windows \ System32 \ WindowsPowerShell \ v1.0.
  • Run this command:
    • Enable-PSRemoting -Force

If everything has gone well you will see a message indicating that “WinRM has been updated to receive requests”. From this moment on, the Windows PC will be ready to receive PowerShell commands from another remote PC that is within the same network .

What if the device is not connected to Active Directory?

In the event that the PC is within a workgroup, but is not registered in Microsoft’s Active Directory, then we will have to apply these other commands.

  • Open PowerShell on the target PC with administrator permissions.
  • Now launch the following command:
    • Set-NetFirewallRule -Name ‘WINRM-HTTP-In-TCP’ -RemoteAddress Any
  • Once the command is processed, the computer will be ready to receive PowerShell commands from another computer.

From here, we must bear in mind that when we connect remotely from PowerShell we will have to validate a username and password for authorized access . In addition to this, if we have problems establishing the connection we may also have to add the target PC to a remote access whitelist.

In short, what we mean is that accessing a remote PC by means of commands can have its complications. In case we are going crazy maybe we should consider using a remote connection tool like TeamViewer or Google’s famous “ Chrome Remote Desktop ” app .

by Abdullah Sam
I’m a teacher, researcher and writer. I write about study subjects to improve the learning of college and university students. I write top Quality study notes Mostly, Tech, Games, Education, And Solutions/Tips and Tricks. I am a person who helps students to acquire knowledge, competence or virtue.

Leave a Comment