Click on Pictures to View

To view a larger version of an image within a post, just click on the picture you want to view :)

Wednesday, December 16, 2015

PsTools & PsExec

If you haven't checked out the PsTools suite yet, go look it up (download link is at the bottom of this post).  It contains several handy tools to work on other machines remotely via command prompt.

My favorite and most used PsTool is psexec.  Psexec allows you to execute commands from a command prompt for another machine.  There are two methods to do this -

From an elevated command prompt (right click command prompt & run as administrator):

             psexec \\JenniPC -s cmd.exe

Replace JenniPC with the name of the remote machine you are trying to run the command on.  The
-s causes the command to be run under the System account.

This command changes the command prompt window to be connected instead to the remote machine.  For example, after running this command, if you run the command hostname it should return the hostname of the remote machine.  Cool, huh?

If you don't want to open/change the command prompt, you can just add your specific command to the end of the psexec command line.  For example:

        psexec \\JenniPC -s ipconfig

This runs ipconfig on remote computer JenniPC and returns the ipconfig output for that machine in the DOS box.

There are a few GUIs out there you can get for the tools, but none of them are perfect.  For example, FrontEnd for PsTools is good, but if you try to run ipconfig under the psexec it doesn't return the correct output - or any output for that matter.

Knowing how to navigate and use a command prompt is a neat skill to have so learning how to use PsTools from cmd.exe is worthwhile and more fun anyway in my opinion.


Resources:

PsTools Download:  https://technet.microsoft.com/en-us/sysinternals/pstools.aspx

FrontEnd for PsTools:  http://www.davitools.com/fepstools/

PsTools GUI: http://sourceforge.net/projects/pstoolsgui/