Solved

How to use psexec.exe

Posted on 2012-03-27
14
1,820 Views
Last Modified: 2012-07-21
Hello techs,
At work, we're allowed to use psexec to assist end users.  However, I am not real sure how it can benefit me.  Do I need to be logged in with my Admin account, or will it work with my regular domain account?  I doubt I am asking the right questions, or am asking all the questions, but psexec seems confusing.  Any assistance is helpful!  Thank you,
mark88
0
Comment
Question by:Mark O'Brien
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 3
  • 2
  • +1
14 Comments
 

Accepted Solution

by:
cmendez6039 earned 150 total points
ID: 37774163
You should log in with a domain admin account so that you don't run into any access issues.

I use the tool to access cmd on the remote computer. so if you need to do anything from the command line in the background this tool is definitely helpful.

Basic syntax:

c:\psexec.exe \\COMPUTERNAME cmd

I think you can use it for other apps but cmd is the only one i have used
0
 
LVL 16

Assisted Solution

by:l33tf0b
l33tf0b earned 200 total points
ID: 37774180
There's a lot of things it can do.  To sum it up - it allows one to run commands on a remote machine as if the user was at the machine.

Download the tool here http://technet.microsoft.com/en-us/sysinternals/bb897553

ONce you've extracted the files - check out the .CHM file - it has several examples of how to use it and when.

By default when it runs commands it runs with your implied rights, however if you were to map or access network resources, you would have to explicitly pipe in a username / password.

I guess the best way is to come up with a scenario of what you wanted to do and post here in the forums.
0
 
LVL 3

Assisted Solution

by:HyperAdvisor
HyperAdvisor earned 150 total points
ID: 37775971
type psexec /? this will give you all the options you need
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Author Comment

by:Mark O'Brien
ID: 37777002
I will try and post a scenario of how we might use psexec soon.
0
 

Author Comment

by:Mark O'Brien
ID: 37877501
A PM just said "we need to learn how to use psexec" but he never told us what we might use it for.
0
 

Author Comment

by:Mark O'Brien
ID: 37898010
Ok so ive been told that we need to use psexec to run a cmd prompt on a remote pc
0
 
LVL 3

Assisted Solution

by:HyperAdvisor
HyperAdvisor earned 150 total points
ID: 37898068
PSexec \\computername Command

you can use it to

list a folder - PSexec \\computername dir c:\windows\system32\

delete a file(S) - PSexec \\computername del c:\temp\*.*

move file(s) - PSexec \\computername ren c:\temp\*.* c:\temp2\*.*

run a batch file - PSexec \\computername BatchFile.bat

stop a service - PSexec \\computername net stop spooler

Start a service - PSexec \\computername net start spooler

map a drive - PSexec \\computername net use h: \\servername\sharename

Install a windows update - PSexec \\computername start /w pkgmgr /ip /m:c:\update\windows6.1-kb2425227-.cab /s:c:\update /l:c:\update\install.log /quiet /norestart

Anything you can do at a dos prompt you can do using PSExec

You can also script variables like the computername to run it on a group of machines
0
 
LVL 16

Expert Comment

by:l33tf0b
ID: 37898115
: Mark88
]Ok so ive been told that we need to use psexec to run a cmd prompt on a remote pc

To do so

Navigate to directory with PSEXEC or hopefully they've set it as part of your Environment variables so you can call from any directory.

psexec \\computername cmd

this brings up the command prompt on your screen but you're working with it as if you were on the user's machine.

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

lists the switches


-i      Run 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.
0
 

Author Comment

by:Mark O'Brien
ID: 37908720
psexec must be installed to the system32 folder.  Anyone have a list of directions that are easy to understand?
0
 

Author Comment

by:Mark O'Brien
ID: 38076330
Is there something special about system32?
0
 
LVL 16

Assisted Solution

by:l33tf0b
l33tf0b earned 200 total points
ID: 38076359
system32 is part of your PATH environment.  It allows you to invoke the PS commands from the start > run without navigating to the folder to run the command.

By copying the PS tools to system32 you can run the command from start > run.
0
 

Author Comment

by:Mark O'Brien
ID: 38091678
What is a "path environment".  Sounds really interesting too.
0
 

Author Comment

by:Mark O'Brien
ID: 38149006
It's interesting that a certain folder such as system32 could be so important.
0
 

Author Closing Comment

by:Mark O'Brien
ID: 38211469
Thank you techs.  Excellent help.
- Mark88
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question