what can PsTools\psexec do!

原文地址: http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

Utilities like Telnet and remote control programs like Symantec's PC Anywhere let you execute programs on remote systems, but they can be a pain to set up and require that you install client software on the remote systems that you wish to access. 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.

Note: some anti-virus scanners report that one or more of the tools are infected with a "remote admin" virus. None of the PsTools contain viruses, but they have been used by viruses, which is why they trigger virus notifications.

Installation

Just copy PsExec onto your executable path. Typing "psexec" displays its usage syntax.

Using PsExec

See the July 2004 issue of Windows IT Pro Magazine for Mark's article that covers advanced usage of PsExec.

Usage: psexec [\\computer[,computer2[,...] | @file][-u user [-p psswd]][-n s][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,... ] cmd [arguments]

computerDirect PsExec to run the application on the computer or computers specified. If you omit the computer name PsExec runs the application on the local system and if you enter a computer name of "\\*" PsExec runs the applications on all computers in the current domain.
@fileDirects PsExec to run the command on each computer listed in the text file specified.
-aSeparate processors on which the application can run with commas where 1 is the lowest numbered CPU. For example, to run the application on CPU 2 and CPU 4, enter: "-a 2,4"
-cCopy the specified program to the remote system for execution. If you omit this option then the application must be in the system's path on the remote system.
-dDon't wait for application to terminate. Only use this option for non-interactive applications.
-eDoes not load the specified account's profile.
-fCopy the specified program to the remote system even if the file already exists on the remote system.
-iRun the program so that it interacts with the desktop of the specified session on the remote system. If no session is specified the process runs in the console session.
-lRun process as limited user (strips the Administrators group and allows only privileges assigned to the Users group). On Windows Vista the process runs with Low Integrity.
-nSpecifies timeout in seconds connecting to remote computers.
-pSpecifies optional password for user name. If you omit this you will be prompted to enter a hidden password.
-sRun remote process in the System account.
-uSpecifies optional user name for login to remote computer.
-vCopy the specified file only if it has a higher version number or is newer on than the one on the remote system.
-wSet the working directory of the process (relative to the remote computer).
-xDisplay the UI on the Winlogon desktop (local system only).
-prioritySpecifies -low, -belownormal, -abovenormal, -high or -realtime to run the process at a different priority. Use -background to run at low memory and I/O priority on Vista.
programName of the program to execute.
argumentsArguments to pass (note that file paths must be absolute paths on the target system)

You can enclose applications that have spaces in their name with quotation marks e.g. "psexec \\marklap "c:\long name\app.exe". Input is only passed to the remote system when you press the enter key, and typing Ctrl-C terminates the remote process.

If you omit a username the remote process runs in the same account from which you execute PsExec, but because the remote process is impersonating it will not have access to network resources on the remote system. When you specify a username the remote process executes in the account specified, and will have access to any network resources the account has access to. Note that the password is transmitted in clear text to the remote system.


Examples

This article I wrote describes how PsExec works and gives tips on how to use it:

http://www.winnetmag.com/Windows/Issues/IssueID/714/Index.html

The following command launches an interactive command prompt on \\marklap:

psexec \\marklap cmd

This command executes IpConfig on the remote system with the /all switch, and displays the resulting output locally:

psexec \\marklap ipconfig /all

This command copies the program test.exe to the remote system and executes it interactively:

psexec \\marklap -c test.exe

Specify the full path to a program that is already installed on a remote system if its not on the system's path:

psexec \\marklap c:\bin\test.exe

Run Regedit interactively in the System account to view the contents of the SAM and SECURITY keys::

psexec -i -d -s c:\windows\regedit.exe

To run Internet Explorer as with limited-user privileges use this command:

psexec -l -d "c:\program files\internet explorer\iexplore.exe"

转载于:https://www.cnblogs.com/raylovelc/archive/2010/08/15/1800273.html

pstools.zip是一个包含PSTools工具集合的压缩文件。PSTools是由微软公司开发的一组命令行实用工具,它们旨在帮助系统管理员更轻松地管理和监控Windows操作系统。pstools.zip文件中包含了几个常用的PSTools工具,例如PsExecPsFile、PsInfo、PsList、PsKill等。 PsExecPSTools工具集中最常用的工具之一。它允许管理员在本地或远程系统上执行命令行程序或批处理文件。通过远程执行命令的功能,管理员可以方便地在多台计算机上进行批量操作,例如安装更新、启动或停止服务等。 PsFile是用于显示系统上已打开文件信息的工具。管理员可以使用PsFile来查看哪些文件被进程打开,以及这些文件的路径、ID和访问权限等。 PsInfo是一个用于查看系统信息的命令行工具。管理员可以通过PsInfo获得有关计算机硬件、操作系统版本、已安装软件以及系统配置等详细信息,这对于故障排除和系统管理非常有用。 PsList是一个类似于任务管理器的工具,它显示当前系统上运行的进程列表。管理员可以使用PsList来监控系统资源的使用情况,包括CPU、内存和网络等。 PsKill是一个强制终止进程的工具。管理员可以使用PsKill来终止应用程序或进程,无论它们是本地运行还是在远程系统上运行。 通过使用pstools.zip中的这些工具,系统管理员可以更高效地管理和监控Windows操作系统,提高工作效率,解决系统问题,并确保系统的正常运行。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值