Windows – Imposible to login with psexec

pstoolswindows

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.

Best Answer

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.