Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using psexec and I cannot execute a simple cmd into a machine. The same response it's always the same "incorrect username or incorrect password" (also returning error code 6). This is the command I use:

"c:\program files\psexec\psexec.exe" \\ -u testUser -p xxxxxxx ipconfig

The user exists and I'm able to use this user to remote access. But the strangest part comes here. If I execute the same command line, but changing the machine name by its IP, then the psexec works fine. I checked if resolves correctly and it works.

EDIT: Forgot to say that both machines are virtual machines into the same hypervisor (ESXI)

Any help is welcome

EDIT: Well, finally resolved by writing an script that makes ping and with the information, it takes the IP. With this IP, I execute psexec correctly. My fear was that if machine changes their IP, an IP hardcoded would be a bad idea, so the script solves my problem.

Thanks to all.

share|improve this question
What versions of Windows on each end (client and server)? Also, is the actual HOST (A) record in dns or is it a a CNAME (alias)? – squillman May 31 '11 at 14:25
The client is a win server 2008 (where psexec is executed) and the server (softtestXP) is a win32 XP SP3. AFAIK, the softtestXP is a HOST, but I'm not completely sure. – Killrazor May 31 '11 at 14:33
up vote 1 down vote accepted

Do you already have a connection to the server in question open that is using a different username? This could be a mapped drive or any other connection (services.msc, etc.). Running "net use" would most likely show this.

This might be an old Windows issue, that doesn't allow you to connect to a given server with more than one username at a time. The work-around is what you already discovered - to use the IP address.

If you have other connections open, try to disconnect them and see if it works then. If you can't disconnect them then I would just keep using the IP address.

share|improve this answer

I would try using the netbios name and the format -u domain\user

share|improve this answer
The netbios user returns the same "6" errorcode. – Killrazor May 31 '11 at 14:39

Have you checked your hosts file (%windir%\system32\drivers\etc\hosts) on the client machine ? Depending on how you "checked if resolves correctly" it may or may not fool you (i.e nslookup resolves fine but ping/psexec points to hardcoded ip)

Also the Windows 2008 might be trying to use IPv6 instead of IPv4 to connect to the XP node when you use host name.

share|improve this answer

Perhaps you have a stale DNS record. Even if nslookup returns the correct IP address, it will not update the DNS cache.

To purge the DNS cache, run ipconfig /flushdns.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.