PSExec: Remote command execution
Ever wondered how to remotely execute a command on a remote machine. Here is what I had to deal with, leading to my research and a subsequent discovery of this powerful utility. We have this ASP.Net project that was getting deployed to the various in-house environments using Hudson, a continuous deployment tool. There was this requirement that the web.config had to be encrypted. In our project configuration setup, the files from the build (CI) server will be deployed/coped to various environments, however the web.config cannot be pre-encrypted, rather it has to be encrypted in the hosting environment.
I have created a batch file that has to be executed on the deployed environment to be able to encrypt the web.config file. PSExec came to my rescue by being able to execute the batch file on the host environments from the continuous integration server. The account that is used to run Hudson should also have rights on the host machines to be able to run PSExec.
PsExec is a light-weight telnet-replacement that lets you execute processes on other systems, complete with full interactivity for console applications, without having to manually install client software. PsExec’s most powerful uses include launching interactive command-prompts on remote systems and remote-enabling tools like IpConfig that otherwise do not have the ability to show information about remote systems. 
Example 1: psexec \\MACHINE_NAME c:\temp\encrypt.bat Example 2: This is very useful when you have to perform am IISReset remote psexec \\MACHINE_NAME IISRESET Example: 3 - Explicitly pass user credentials psexec \\MACHINE_NAME -u USERNAME -p PASSWORD IISRESET Example: 4 - Use this to encrypt the web.config settings after a deployment using Hudson psexec aspnet_regiis -pef appSettings
I hope I made my point in showcasing a capability of this tool. Here is a good read about the inner working of psexec.
1. PSExec – by Mark Russinovich