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" \\softtestsXP.test.int -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 softtestsXP.test.int 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.

  • 1
    What versions of Windows on each end (client and server)? Also, is softtestsXP.test.int 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

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.


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

  • 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 softtestsXP.test.int 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.


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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