How to use psexec.exe

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
Mark O'BrienDispatch Software Support and Server AdministrationAsked:
Who is Participating?
 
cmendez6039Connect With a Mentor Commented:
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
 
Raymond PengConnect With a Mentor Systems EngineerCommented:
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
 
HyperAdvisorConnect With a Mentor Commented:
type psexec /? this will give you all the options you need
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
Mark O'BrienDispatch Software Support and Server AdministrationAuthor Commented:
I will try and post a scenario of how we might use psexec soon.
0
 
Mark O'BrienDispatch Software Support and Server AdministrationAuthor Commented:
A PM just said "we need to learn how to use psexec" but he never told us what we might use it for.
0
 
Mark O'BrienDispatch Software Support and Server AdministrationAuthor Commented:
Ok so ive been told that we need to use psexec to run a cmd prompt on a remote pc
0
 
HyperAdvisorConnect With a Mentor Commented:
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
 
Raymond PengSystems EngineerCommented:
: 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
 
Mark O'BrienDispatch Software Support and Server AdministrationAuthor Commented:
psexec must be installed to the system32 folder.  Anyone have a list of directions that are easy to understand?
0
 
Mark O'BrienDispatch Software Support and Server AdministrationAuthor Commented:
Is there something special about system32?
0
 
Raymond PengConnect With a Mentor Systems EngineerCommented:
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
 
Mark O'BrienDispatch Software Support and Server AdministrationAuthor Commented:
What is a "path environment".  Sounds really interesting too.
0
 
Mark O'BrienDispatch Software Support and Server AdministrationAuthor Commented:
It's interesting that a certain folder such as system32 could be so important.
0
 
Mark O'BrienDispatch Software Support and Server AdministrationAuthor Commented:
Thank you techs.  Excellent help.
- Mark88
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.