[Tutorial] How to Run PsExec in PowerShell
PsExec is a powerful command-line tool that allows you to execute processes on remote systems using Command Prompt. For this reason, it has become the go-to choice for many IT professionals. However, you might wonder if it can be executed in PowerShell and how to run PsExec in PowerShell on remote computer.
In this guide, you will learn how to run PsExec in PowerShell in a few simple steps.
Part 1. Can you run PsExec in PowerShell?
The short answer to this question is yes, you can run PsExec in PowerShell! But before explaining the steps for doing that, it‘s important to explain what PsExec is and how PowerShell can be used to execute it.
- PsExec is part of the Sysinternals Suite, which was developed by Microsoft. In essence, it is a remote administration tool that allows users to execute processes on remote devices without needing to install a client. This tool has quickly become a necessity for system administrators since it can run commands on remote systems effortlessly.
- PowerShell, on the other hand, is a powerful scripting language and command-line shell also developed by Microsoft. It extends the capabilities of the traditional Command Prompt and is designed for managing complex environments.
By combining PsExec with PowerShell, you can create a better and more optimized remote management experience. PowerShell allows you to automate tasks, while PsExec makes it possible to execute the scripts on your remote devices. Therefore, you can run PsExec in PowerShell remote computer to open up a new world of possibilities in remote support.
Part 2. How to Run PsExec in PowerShell?
Now that we have explained how PsExec and PowerShell fit together, we can get into more detail about how to execute PsExec in PowerShell. The steps for doing that are the following:
1Prepare Your Devices
Before you even begin the process, you need to ensure that you have enabled the Windows Firewall. To do that:
- 1.Open Windows Defender Firewall with Advanced Security, and check whether the Firewall is on for all profiles.
- 2.If not, click the Windows Defender Firewall Properties and check the Firewall state to On.
Another thing you need to do before you run PsExec in PowerShell is to open Port TCP/445 and Port UDP/137. To do that:
- 1.Launch Windows PowerShell (Admin).
- 2.Type the command New-NetFirewallRule -DisplayName 'TCP/445' -Profile @('Domain') -Direction Inbound -Action Allow -Protocol TCP -LocalPort @('445') -RemoteAddress [IP_Address] to open Port TCP/445.
- 3.Type the command New-NetFirewallRule -DisplayName 'UDP/137' -Profile @('Domain') -Direction Inbound -Action Allow -Protocol UDP -LocalPort @('137') -RemoteAddress [IP_Address] to open Port UDP/137.
2Download and Install PsExec
- 1.Before you can use PsExec in PowerShell, you also need to download it from the official Sysinternals website. You can find it available for free. Once downloaded, extract the PsExec.exe file to a directory of your choice.
- 2.Run the command “.\PsExec \\[Remote-desktop] cmd” to ensure that you can use PsExec on the remote device.
3Run PsExec in PowerShell
With all of the above set, you can now run PsExec in PowerShell on the remote computer. All of the tasks that you will want to complete follow the command "psexec \\[Remote-desktop] command [arguments]".
To better illustrate what you can do, we are going to show you some more specific examples:
- psexec -i \\[Remote-desktop]cmd - launch the Command Prompt on the remote device.
- psexec -i \\[Remote-desktop]ipconfig - Execute the command “IpConfig” on the remote device.
- psexec -i \\[Remote-desktop]-c test.exe - Copy the program “test” to the remote device and execute it.
- psexec -i \\[Remote-desktop]c:\bin\test.exe - Name the full path of a program.
- psexec -i -d -s c:\windows\regedit.exe - Run the command “RegEdit” on the remote device.
- psexec -l -d “c:\program files\internet explorer\iexplore.exe” - Lauch Internet Explorer on the remote device.
- psexec \\pc1shutdown/r/t60 - Reboot the remote device in 60 seconds.
- psexec \\pc1-i paint - Launch the program “Paint” on the remote device.
Part 3. Better Way to Remote Control a Computer
While PsExec in PowerShell is a powerful solution for remote management, it might not be the most beginner-friendly option. In fact, if you don't have technical knowledge, you might find its use very daunting. In that case, we recommend AirDroid Remote Support that makes remote support an effortless and intuitive process.
AirDroid Remote Support is a tool to satisfy the needs of both individual users and professionals for quick and easy remote access to their devices. Unlike PsExec, which requires command-line knowledge, AirDroid has a user-friendly visual interface that is easy to navigate and doesn't require technical knowledge.
Key Features of AirDroid Remote Support
- Real-time Support: Take full control of the remote device in real-time to provide the best remote support service.
- Attended and Unattended Access: Connect to both attended and unattended devices.
- Easy File Transfer: Easily transfer files between your devices through the intuitive chat window.
- Voice Call and Text Chat: Communicate with the person on the remote device effectively through text messages and voice calls.
- Black Screen Mode: This patented innovation turns the remote device’s screen black whenever you establish an unattended remote session to protect your privacy.
As we’ve already mentioned, AirDroid Remote Support is a very straightforward and beginner-friendly tool. The steps for using it are the following:
- Step 1.Sign up an AirDroid Remote Support account from the official website. Then isntall AirDroid Business on the local PC and install AirDroid Remote Support on the remote PC.
- Step 2.Launch AirDroid Business and click ID Connect. Enter the 9-digit code from AirDroid Remote Support.
- Step 3.On the remote PC, there will be a pop-up message. Click Accept to establish the connection.
Wrapping Up
Running PsExec in PowerShell is a powerful way to manage remote systems, especially if you have the technical knowledge it requires. However, if you’re looking for a more user-friendly solution, AirDroid Remote Support offers a compelling alternative. Its intuitive interface, as well as its set of advanced features, allows you to complete any task you wish effortlessly. Try AirDroid Remote Support today to make the most out of your remote management sessions.
Leave a Reply.