Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to use psexec.exe

Posted on 2012-03-27
14
Medium Priority
?
1,855 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 600 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:Raymond Peng
Raymond Peng earned 800 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 600 total points
ID: 37775971
type psexec /? this will give you all the options you need
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 600 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:Raymond Peng
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:Raymond Peng
Raymond Peng earned 800 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

618 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