![]() Using Ps. Tools to Control Other PCs from the Command Line. In today’s lesson in our Geek School series covering Sys. Internals, we’re going to show you how to use the Ps. Tools set of utilities to perform all sorts of administration tasks both locally, and on remote computers as well. If you’ve ever wanted to connect to another computer and run a command, quickly get information about processes running and optionally kill them, or even stop a service on another PC, you can use the Ps. Tools utilities to do all of these things and even more. ![]() Obviously you can use Remote Desktop or a similar service to connect to any Windows computer and actually see the desktop and do anything that you would do locally, but the Ps. Tools utilities allow you to do many tasks from the command line — or better yet, from a script that you can re- use later. These are the type of utilities that work best in a corporate environment, and mastering these tools will definitely make you much better at your system administration job, save you time, and let you do things in a much smarter way. Doing things smarter and faster is a critical skill for being a great sysadmin. There are twelve tools in the Ps. Tools set, and while some of them are extremely useful, others have been superseded with tools built into more recent versions of Windows, and there are a few others which aren’t useful for most people. We’ll go through all of them so you understand how they work and why you might want to use each one. Ps. Exec – executes processes on a remote computer. Ps. File – shows files that are opened on the remote computer through the network. Ps. Get. Sid – displays the security identifier for a computer or user. Ps. Info – lists information about a system. Ps. Kill – kills processes by name or IDPs. List – list information about processes on the command line. When the Windows Server 2003 computer you are working on will not shut down and you don't have any luck using the Start menu or the Restart or Shutdown Windows Computer Using CMD and SHUTDOWN Commands from the Command Line Restarting or shutting down a Microsoft Windows computer is relatively easy. We are a freeware download site without ads or fake download buttons. You will find freeware software programs, video games, retro games and anti-malware tools. GoldSolution's PC Auto Shutdown answers many needs with flexible options for scheduling automatic shutdown, power-off, restart, hibernate, and other commands. Integrated Shut Down Features & Commands. Many file-downloading programs contain integrated support for automatically shutting down your computer when they’re. Ps. Logged. On – list accounts that are logged on either on the machine or connecting remotely. Ps. Log. List – pull the event log on the command line. Ps. Passwd – change the password for users. Ps. Ping – a fairly simple ping utility with some additional features. Ps. Service – list and make changes to Windows services. ![]() The shutdown command allows you to shutdown a Windows XP, Vista, 7, 8, or 10 computer from the command line, as well as perform additional features that are not. Ps. Shutdown – shut down, log off, or suspend a computer. Ps. Suspend – suspend and resume processes (rather than killing them)It’s worth noting that you can use a tool like Ps. Exec to execute all sorts of command- line utilities on remote computers. The possibilities are endless once you’ve embraced the power of Ps. Tools. All of these tools can be used on local computers, but they are mostly useful for connecting to remote computers and performing commands on them. Connecting to Remote Computers ( Syntax for All Utilities)All of the utilites can be run on either the local or remote computer, so they all have the same first argument for computer name if needed. ![]() The shutdown command is used to shut down or restart remote computers. The shutdown command will also shut down, restart, hibernate, or log off your own PC. Windows 7 Remote Shutdown Commands Windows 7 Shutdown Command Line Switches Shutdown is an interesting command line program found in Windows 7 and earlier operating. This article will show you how to use the remote shutdown command tool in Windows to remotely shutdown or restart a local or networked computer. This can b. Windows 10 questions and answers. Updated: 05/19/2017 by Computer Hope. Reference Question; Windows 10: Microsoft Windows 10 dictionary definition and related terms. Note that you could use the IP address if you wanted instead. If you omit this argument, the command will operate on your local computer. You can also list multiple computers like psinfo \\computer. The final syntax is psinfo \\* which operates on all computers in the domain, which probably isn’t something you’ll use every day. If you need to connect with alternate credentials because your local computer’s account has a different username and password than the other computer, you can use the - u and - p options, though we’d note that you might not want to use - p on the command line with a password in the command for security reasons. Update: as of the latest release of Ps. Exec, no tool passes passwords as clear text anymore, so the only worry is if somebody can read your script files and see the password there. Password”The “user” part of the command would change to “DOMAIN\user” if you are in a domain environment and need to change from the currently running user. Note: you will generally need to connect to the remote computers with an administrator account. Configuring Remote Administration Access. If you are in a domain environment, which most people that need to use Ps. Tools will be, you can ignore this section entirely as everything should work just fine. For anybody running Windows 7, 8, or Vista in a home environment or using a couple of computers in an office without a domain, you will need to tweak User Account Control on the remote computer to allow Ps. Tools to properly run. The problem is described well by Microsoft: When a user who is a member of the local administrators group on the target remote computer establishes a remote administrative connection by using the net use * \\remotecomputer\Share$ command, for example, they will not connect as a full administrator. The user has no elevation potential on the remote computer, and the user cannot perform administrative tasks. To explain it in a different way, when you try to connect to another computer and run something that requires administrator access, there is no way to trigger the UAC prompt and accept it from your computer, so it won’t connect as administrator. And this isn’t a bad thing. You shouldn’t change this setting without fully understanding that you will be allowing an opening for malware to spread from one computer to another — assuming that malware has your local username and password, and that password is the same as the other computer, and the malware is that tricky, which most isn’t. But it still isn’t something to be taken lightly. And again, if you are in a domain environment, this problem doesn’t exist and doesn’t need to be changed. And if you are just testing with a bunch of virtual machines, you don’t have much to worry about. To tweak UAC to enable Ps. Tools to run you’ll want to open up the Registry Editor and navigate to the following key: HKEY. You don’t have to restart the computer to make the setting take effect. Note: just to clarify, this setting needs to happen on the remote computer that you are connecting to. Ps. Exec. Ps. Exec is probably the most powerful tool in the kit, as you can execute any command in your local command prompt just like executing it on the remote computer. That includes anything that can be run on the command line — you can change registry values, run scripts and utilities, or connect from that PC to another one. The output of the commands will be shown on your local PC, rather than on the remote one. The syntax is simple: psexec \\computername < options> apptorun. Realistically, though, you would want to also include the username and password on the command line. For example, to connect to another PC and check the network connections list, you would use something like this: psexec \\computername - u User - p Password ipconfig. That command would produce output similar to the following: If you want to pass the output of a command into another command, or you wanted to redirect the output into a file, you would normally just do something like command. Ps. Exec. So a command like the following will save the output of netstat - an into a file on your Local computer’s root directory. C: \connections. txt. If you want to pass the > or . That, of course, means that we will actually need to use the command shell on the remote computer, and not just run the process, so we can do the redirect or pipe in the first place. So that makes our command like this (changing the path to the home directory where we have write access). C: \users\geek\connections. This example would place the list of open connections generated by netstat into the home directory of the user on the remote computer, in a file named connections. Copying Programs to the Remote PCYou aren’t limited to just the applications on the remote PC when using Ps. Exec, and in fact, you can run anything that you have locally. For instance, if you wanted to do an Autoruns command- line scan of the remote system, but you only had autorunsc. Ps. Exec will remove the tool from the remote system once the command is finished. This is an important time to mention the - accepteula option of most of the Sys. Internals tools, which will make sure that the EULA has been accepted on the computer where the command has been run. We’ll need to add this onto the autorunsc. There are a few other options that specify whether the application is always copied, or if it should be copied if the local application is a higher version than the remote one. You can just run psexec from the prompt to see those options. Note: If a command is only available in the command prompt, you need to add cmd /c before it. This includes pipes and redirects like . You would probably want to combine this with the - d switch, which doesn’t wait for the remote process to end before Ps. Exec returns control to you. For instance, this command would open a Notepad window on a remote computer: psexec \\computername - d - i notepad. You can also choose to run as the SYSTEM user with the - s option, which can be very dangerous. For example, if you wanted to open the Registry Editor on your own computer, but with SYSTEM user- level permissions, you could run this command. In case you are wondering, yes, this will give you access to a lot of things that you normally wouldn’t have access to edit in the registry. And yes, it’s a really bad idea. Running a Full Command Prompt through Ps. Exec. Yes, we just showed you all of those examples of how to run a single command through Ps. Exec. It’s just like you were on the console of that server (for the most part). And luckily, the syntax for this one is really easy (add the username if you need to). Once you’ve done this, you’ll have a command prompt that is now running on the remote PC. The command prompt will work almost like normal, except tab completion isn’t going to operate at all, but that’s just fine with us. It’s worth noting that if you want to run Power. Shell commands remotely on another computer, you can do that natively with some tweaks to the configuration. Unfortunately Power. Shell doesn’t work very nicely with Ps. Exec unless you use a bunch of weird workarounds that aren’t worthwhile.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
September 2017
Categories |