Solved

How to use psexec.exe

Posted on 2012-03-27
14
1,703 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:Mark88
  • 8
  • 3
  • 2
  • +1
14 Comments
 

Accepted Solution

by:
cmendez6039 earned 150 total points
Comment Utility
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
Comment Utility
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
Comment Utility
type psexec /? this will give you all the options you need
0
 

Author Comment

by:Mark88
Comment Utility
I will try and post a scenario of how we might use psexec soon.
0
 

Author Comment

by:Mark88
Comment Utility
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:Mark88
Comment Utility
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
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 16

Expert Comment

by:l33tf0b
Comment Utility
: 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:Mark88
Comment Utility
psexec must be installed to the system32 folder.  Anyone have a list of directions that are easy to understand?
0
 

Author Comment

by:Mark88
Comment Utility
Is there something special about system32?
0
 
LVL 16

Assisted Solution

by:l33tf0b
l33tf0b earned 200 total points
Comment Utility
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:Mark88
Comment Utility
What is a "path environment".  Sounds really interesting too.
0
 

Author Comment

by:Mark88
Comment Utility
It's interesting that a certain folder such as system32 could be so important.
0
 

Author Closing Comment

by:Mark88
Comment Utility
Thank you techs.  Excellent help.
- Mark88
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now