Solved

How to use psexec.exe

Posted on 2012-03-27
14
1,773 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
  • 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
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). …
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.

860 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