Solved

psexec does not seem to work with windows 2003

Posted on 2009-05-15
7
938 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
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: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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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.

770 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