Solved

How to use psexec.exe

Posted on 2012-03-27
14
1,723 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
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
 

Author Comment

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

Author Comment

by:Mark88
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:Mark88
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
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)

 
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:Mark88
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:Mark88
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:Mark88
ID: 38091678
What is a "path environment".  Sounds really interesting too.
0
 

Author Comment

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

Author Closing Comment

by:Mark88
ID: 38211469
Thank you techs.  Excellent help.
- Mark88
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This collection of functions covers all the normal rounding methods of just about any numeric value.
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 …
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

911 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

16 Experts available now in Live!

Get 1:1 Help Now