Solved

psexec does not seem to work with windows 2003

Posted on 2009-05-15
7
936 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
Comment Utility
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_
Comment Utility

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
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:it_
Comment Utility

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
Comment Utility
By chance are the 2003 machines attached to an active directory domain?
0
 

Author Comment

by:it_
Comment Utility

Thanks for your continuing help.

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

Author Closing Comment

by:it_
Comment Utility
found another solution
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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…
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.

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

11 Experts available now in Live!

Get 1:1 Help Now