PsExec tool
This is a simple but elegant tool. A tool which is known to all system adminstrators, but still not used as often as it should be. PsExec is a tool which comes as part of PsTools suite from Microsoft which is used to execute programs in machines remotely.
PsExec lets you execute processes on remote systems and redirects the output to the local system without having to manually install client software.
Are you wondering why it is different from Microsoft Telnet ? Of course, no client required on the remote machine as in case of Telnet.
For PsExec to work, two requirements need to be satisfied:
psexec [\\computer[,computer2[,...] | @file]][-u user [-p psswd][-n s][-r servicename][-h][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,...] cmd [arguments]
psexec \\RemoteMachineNameOrIP 'application'
For eg: psexec \\testmachine "cmd.exe"
To execute the program testapp.exe in the remote system and executes it interactively:
psexec \\testmachine "D:\Test Folder\testapp.exe"
To copy the program testapp.exe from the local machine to the remote system and executes it interactively:
psexec \\testmachine -c "D:\Test Folder\testapp.exe"
If you don't specify the path of the program you want to execute, PsExec looks in the \windows\system32 directory of the remote system and if you don't specify the credentials, PsExec will use the current login credentials of the local system.
PsExec lets you execute processes on remote systems and redirects the output to the local system without having to manually install client software.
Are you wondering why it is different from Microsoft Telnet ? Of course, no client required on the remote machine as in case of Telnet.
For PsExec to work, two requirements need to be satisfied:
- Both the local and remote computers have file and print sharing enabled (Workstation and Server services)
- Default Admin$ share (a hidden share that maps to the \windows directory) is defined on the remote system
psexec [\\computer[,computer2[,...] | @file]][-u user [-p psswd][-n s][-r servicename][-h][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,...] cmd [arguments]
psexec \\RemoteMachineNameOrIP 'application'
For eg: psexec \\testmachine "cmd.exe"
To execute the program testapp.exe in the remote system and executes it interactively:
psexec \\testmachine "D:\Test Folder\testapp.exe"
To copy the program testapp.exe from the local machine to the remote system and executes it interactively:
psexec \\testmachine -c "D:\Test Folder\testapp.exe"
If you don't specify the path of the program you want to execute, PsExec looks in the \windows\system32 directory of the remote system and if you don't specify the credentials, PsExec will use the current login credentials of the local system.
Comments
Post a Comment