PSTools

how to get the PSTools?

from here:http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

After download the PSToos, you can extra teh PSToos, thenk you will get a set of PC tools. that cotains PSshutdow,PSExec etc.

 

http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx

Introduction

The Windows NT and Windows 2000 Resource Kits come with a number of command-line tools that help you administer your Windows NT/2K systems. Over time, I've grown a collection of similar tools, including some not included in the Resource Kits. What sets these tools apart is that they all allow you to manage remote systems as well as the local one. The first tool in the suite was PsList, a tool that lets you view detailed information about processes, and the suite is continually growing. The "Ps" prefix in PsList relates to the fact that the standard UNIX process listing command-line tool is named "ps", so I've adopted this prefix for all the tools in order to tie them together into a suite of tools namedPsTools.

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.

The tools included in the PsTools suite, which are downloadable as a package, are:

  • PsExec - execute processes remotely
  • PsFile - shows files opened remotely
  • PsGetSid - display the SID of a computer or a user
  • PsInfo - list information about a system
  • PsPing - measure network performance
  • PsKill - kill processes by name or process ID
  • PsList - list detailed information about processes
  • PsLoggedOn - see who's logged on locally and via resource sharing (full source is included)
  • PsLogList - dump event log records
  • PsPasswd - changes account passwords
  • PsService - view and control services
  • PsShutdown - shuts down and optionally reboots a computer
  • PsSuspend - suspends processes
  • PsUptime - shows you how long a system has been running since its last reboot (PsUptime's functionality has been incorporated intoPsInfo)

The PsTools download package includes an HTML help file with complete usage information for all the tools.

 

========================================

The folloiwng content is about how to use PSShutdow of PSTools to reboot a PC(local or remote which you have full amdin)

PsShutdown (PsTools)

Initiate a shutdown/reboot of a local or remote computer, logoff a user, lock a system.

Syntax
      psshutdown [[\\computer[,computer[,..] | @file [-u user [-p passwd]]]
         -s|-r|-h|-d|-k|-a|-l|-o 
            [-f] [-c] [-t nn|h:m] [-n s] [-v nn]
               [-e [u|p]:xx:yy] [-m "message"]
Options:

   computer   The computer on which the user account resides. Default=local system 
              a wildcard (\\*), will affect all computers in the current domain.

   -p passwd  Specify a password for user (optional). Passed as clear text.
              If omitted, you will be prompted to enter a hidden password.

   -u user    Specify a user name for login to remote computer(optional).

   @file      Execute the command on each of the computers listed in the file.

   -a         Abort a shutdown (only possible while a countdown is in progress)

   -c         Allow the shutdown to be aborted by the interactive user

   -d         Suspend the computer

  -e [u|p]:xx:yy 
              Shutdown reason code, 'u' = user, 'p'= planned shutdown.
              xx is the major reason code (must be less than 256)
              yy is the minor reason code (must be less than 65536)

   -f         Force all running applications to exit during the shutdown
              instead of giving them a chance to gracefully save their data.

   -h         Hibernate the computer

   -k         Poweroff the computer (reboot if poweroff is not supported)

   -l         Lock the computer

  -m "message" Specify a message to logged-on users when a shutdown countdown commences

   -n         Timeout in seconds connecting to remote computers

   -o         Logoff the console user

   -r         Reboot after shutdown

   -s         Shutdown without poweroff

   -t         Countdown in seconds until the shutdown (default: 20 seconds)
              or the time of shutdown (in 24 hour notation)

   -v         Display message for the specified number of seconds before the shutdown. 
              default= display a shutdown notification dialog,
              specifying a value of 0 results in no dialog.

   -          Help, display the supported options.

This tool allows administrators to create a batch file that will run against multiple computers to perform a mass change of the administrator password.

Examples:

Reboot \\workstation64 as part of an OS upgrade

psshutdown \\workstation64 -r -e p:2:3

“I shall go the way of the open sea, To the lands I knew before you came,
And the cool ocean breezes shall blow from me, The memory of your name” ~ Laurence Hope

Related:

SHUTDOWN - With full list of reason codes
TSSHUTDN - Remotely shut down or reboot a terminal server
Powershell:
$os = (Get-WmiObject Win32_OperatingSystem -ComputerName MyServer64)
$os.psbase.Scope.Options.EnablePrivileges = $true
$os.reboot()

Equivalent bash command (Linux): shutdown - Shutdown or restart linux

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值