Solved

psexec does not seem to work with windows 2003

Posted on 2009-05-15
7
937 Views
Last Modified: 2013-11-17
when running
psexec \\IP -u <username> -p <password> cmd

I get:
cmd exited on <IP> with error code 1

This does not happen on wndows 2008, Vista etc where the cmd runs succesfully..

when I run

psexec \\IP -u <username> -p <password> c:\windows\notepad.exe

It does kick off notepad I can see in the processes.
0
Comment
Question by:it_
  • 4
  • 3
7 Comments
 
LVL 5

Accepted Solution

by:
epochasset earned 250 total points
ID: 24397804
You can run into problems if youve used different verisons of psexec over time.  First, verify you are using the latest version of psexec.  On the 2003 server, check for a left over psexec service via,

sc query | find /i "psexec"

If one is present stop it via 'net stop' and then delete it via 'sc delete %name%', then try running psexec remotely again.

If none of this helps, try remotely executing different programs to see if its all programs in general or just notepad.exe.  Check that on the 2003 server, notepad.exe is in its original form (if its not, consider using sfc.exe to check files).  Also, a virus scan would be standard practice if anything is not working as it normally should (considering that you observed it actually launch notepad).
0
 

Author Comment

by:it_
ID: 24398056

Thanks Epohchasset.

It somehow seems to be only happening with "all" Win 2003 machines all other machines are fine. Using 1.95.
0
 
LVL 5

Expert Comment

by:epochasset
ID: 24399018
Lets try some variations on the psexec usage.

If you want to spawn a gui app like notepad, your going to want to use psexec's -d flag so it doesnt wait for notepad to close on the other end,

psexec \\IP -d -u <username> -p <password> c:\windows\notepad.exe

Also oftentimes you will want to use psexec through the command interpreter like this,

psexec \\IP -u <username> -p <password> cmd.exe "/c c:\windows\notepad.exe"

0
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.

 

Author Comment

by:it_
ID: 24399369

Thanks epochasset!

The thing is I m able to kick off a process but not run commands like cmd. And it is *only* on Win2003 boxes. All other environments work just fine. I tried to search quite a bit to see if there is anything specific about 2003. PSEXECSVC seems to run fine on 2003. This is not one machine. Two different machines and a VM with 2003 that I tried 1.95 with and all seem to have the problem i.e.  

when running
psexec \\IP -u <username> -p <password> cmd

I get back:
cmd exited on <IP> with error code 1
0
 
LVL 5

Expert Comment

by:epochasset
ID: 24400857
By chance are the 2003 machines attached to an active directory domain?
0
 

Author Comment

by:it_
ID: 24412013

Thanks for your continuing help.

Yes the 2003 machines are connected to active directory domain..
0
 

Author Closing Comment

by:it_
ID: 31581993
found another solution
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

Suggested Solutions

Title # Comments Views Activity
Union rows in array that have common elements 2 89
post4 challenge 28 93
Updating statistics with error notification email in SQL server 4 73
html form to write data to csv 24 97
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

920 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

13 Experts available now in Live!

Get 1:1 Help Now