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?

ayyob khademi
  • 93
  • 1
  • 1
  • 6

4 Answers4

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?

Bob
  • 597
  • 2
  • 8
  • 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. – John Gardeniers Aug 28 '12 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. – ayyob khademi Aug 29 '12 at 05: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 06 '13 at 07: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
ayyob khademi
  • 93
  • 1
  • 1
  • 6
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

A N
  • 111
  • 3
0

You could try to write password in quotes like:

psexec \\192.168.0.4 -u Administrator -p "adminPass" ipconfig
user11392
  • 111