PsExec is a utility tool that allows system administrators to control a computer from a remote location. It is a command line interface that does not require software installation like some of the popular remote administrative tools.
You are definitely wondering how this is possible, right? In this article, you will learn how to download and install PsExec, how to run it, and some basic commands to get started. Without much ado, dive in!
What is PSExec?
PsExec is a versatile system administrative tool from Microsoft that you can use to remotely access a target host. The utility tool is part of the Sysinternals Suites created by Mark Russinovich. Its main purpose is to help system administrators perform remote maintenance tasks and execute commands on the target host. As a command line interface, PsExec only requires you to provide the destination address, user details and password to gain access to the destination computer.
Unlike Telnet and Remote Desktop Protocol (RDP), PsExec will also not ask you to install a client program on your PC or other software on the remote host. PsExec can redirect the input and output of console applications.
For example, if you remotely access a computer with IP address 192.168.79.32 and run an ipconfig command in PsExec, i.e.
psexec \ 192.168.79.32 ipconfig
You will see the output of ipconfig (that is, the TCP/IP configuration of the remote system) on your personal computer as if you were running the command on the local host. This capability makes PsExec different from many Windows administrative console tools.
How to install and configure PsExec
PsExec does not require the installation of any client software or advanced configuration on the remote host before connecting. So if PsExec doesn’t require any configuration like other traditional administrative tools, how does it work?
PsExec is just a command line utility tool. All you need to do is download PsTools suites on localhost. It is a ZIP file available from Sysinternals.
After downloading, extract PsTool.zip. To do this, right-click on the ZIP file and select Extract All from the menu.
Once you have downloaded and extracted PsExec on your computer, open the folder where the extracted file is located. Replace whatever is in the navigation bar at the top of the extracted folder with CMD and press Enter . This process will open a command prompt window in the PsExec folder.
Running PsExec and connecting to a remote computer
Once you have downloaded PsExec to your remote computer, the next step is to configure it to connect to a target host. For PsExec to run and connect to a remote host, there are three basic prerequisites that you must implement. These are:
1. Turn on File and Printer Sharing
File and printer sharing must be enabled on both the local and remote host. To enable file and printer sharing, open Windows Settings > Network and Internet and scroll to Network and Sharing Center.
On the left side of the opened window, click Change advanced sharing settings. Select Turn on File and Printer Sharing and save your changes.
2. Enable the administrative share ($Admin) on the remote host
The remote computer must have its administrative share ($admin) enabled and properly configured to provide access to your windows folder.
The administrative share ($admin) allows a system administrator to manage multiple computers on a company or workgroup network by accessing the drives and folders within them.
To enable the administrative share ($admin) on the remote computer, press Win key + r , type lusrmgr.msc and press OK.
In the new window, open the Users folder. Right-click on Administrator and select Properties.
In the Properties window, uncheck the Account disabled box and click OK. Right-click Administrators again and click Set Password to set your account password.
3. Get admin details
Have the correct user credential of the remote computer, i.e. IP address, administrative account username and password.
How to use PsExec?
For PsExec to work correctly, its syntax must be exact. Therefore, you must understand the way it works and write the commands as intended.
Therefore, to access a remote host, you must provide the target host’s credentials (IP address, username, and password) with your preferred commands.
For example, to run ipconfig on a remote system with an IP address of 192.168.89.323 and a password of “12345”, you can open a PsExec CMD console and enter:
C:\PsExec\192.168.89.323 –u Administrator –p 12345
If your entered command is executed successfully on the remote system, it will transfer the text output to your command window.
Basic PsExec Commands for New Users
We believe that by now you have understood what PsExec is and the correct way to connect a local system to a remote system. So for new users, using the PsExec tool can be a bit confusing because you need to follow the syntax for it to work. These are the basic commands that all PsExec users should know.