3

I have 2 machines with Windows XP SP2 Professional on the same workgroup;

I can ping each of them from the other one;

My psexec command(run from machine with ip: 192.168.0.3):

psexec \\192.168.0.4 -u Administrator -p adminPass ipconfig

return:

Couldn't access 192.168.0.4:
Logon failure: unknown user name or bad password.

I disabled firewall on both machines, psexec can access the other machine very quickly but as I mentioned above every time it says "unknown user name or bad password.";

What is wrong with my psexec command?

1
  • Fully qualified username solved this issue in my case.
    – gpuguy
    Nov 28, 2013 at 5:38

4 Answers 4

4

try using a fully qualified username: psexec \192.168.0.4 -u {targetmachinename}\Administrator -p adminPass ipconfig

That'll tell the machine what context to use for that username. BTW, the "Administrator" account is enabled on that machine, right? Can you manually login using that account?

3
  • To elaborate, unless specified otherwise psexec (as well as any other command) will use the local account by default. As the local Administrator account is not the same as the remote Administrator account you must tell psexec which one you want to use. Pinging a machine does not require access permissions to the remote machine, at least not in the same sense. Aug 28, 2012 at 20:30
  • 1
    Yes, Administrator account is enabled on both machines and I logged on with Administrator account several times, no problem; I also used you'r advised command (using a fully qualified username), but psexec still says that: "Logon failure: unknown user name or bad password."; If help: I can use remote desktop to connect to the other one without any problem. Aug 29, 2012 at 5:49
  • Fixed my problem. Was getting: Couldn't access 192.168.140.131: The user name or password is incorrect. --- I can use a standard account but needed to fully qualify username per answer. I also needed "reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f", and "sc start RemoteRegistry" (both on target machine).
    – Straff
    Oct 6, 2013 at 7:50
2

Solved!

I must enable Access hidden share on the target PC,

Start > Run > secpol.msc > Local Policies > Security Options > 
Network Access: Sharing and security model for local accounts > Classic – local users authenticate as themselves
1

This only worked for me when I added credentials using cmdkey:

cmdkey.exe /add:MACHINE_NAME_HERE /user:MACHINE_NAME_HERE\Administrator /pass:PASSWORD_HERE
psexec.exe \\MACHINE_NAME_HERE -i notepad
cmdkey.exe /delete:MACHINE_NAME_HERE

Source: https://stackoverflow.com/a/22044694/4995840

1
  • Excellent find. This worked for me. Sep 20, 2017 at 17:09
0

You could try to write password in quotes like:

psexec \\192.168.0.4 -u Administrator -p "adminPass" ipconfig

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .