psexec logon failure: "unknown user name or bad password."

14

1

i'm trying to run an interactive commandline on a remote PC in my LAN using

psexec \\192.168.1.103 -u user2 -p pass1234 -c cmd

and I get

Logon failure: unknown user name or bad password.

is there anything I'm missing here? The user is created, I can connect to it with RDP. The host is Windows XP, and I'm running the commands from Windows 7, where I have psexec.exe.

agelmarion

Posted 2011-06-24T22:16:02.260

Reputation: 143

Are you on a domain? If so what is the format you are using for the user? Also, I don't know if this matters, but are you running psexec on Win 7 at an elevated command prompt? – KCotreau – 2011-06-24T22:19:45.703

i'm not in a domain – agelmarion – 2011-06-24T22:20:39.370

elvated not working, do i need to run something on the target computer? – agelmarion – 2011-06-24T22:22:35.310

Answers

8

I was able to reproduce your problem and fix it thus:

Do The following and hit enter

Start>Run>secpol.msc

Navigate to

Local Policies>Security Options

Set the policy "Network Access: Sharing and security model for local accounts" to (Just hit OK: Don't close this out as we will be changing it back).

Guest only – local users authenticate as Guest

Open a command box and run (Dont close this either)

gpupdate /force

Go back and set the policy "Network Access: Sharing and security model for local accounts" back to

Classic - local users authenticate as themselves

Again run

gpupdate /force

It should work now.

KCotreau

Posted 2011-06-24T22:16:02.260

Reputation: 24 985

Does anyone know what causes this? I've been running psexec on all the lab computers for over a year, but one keeps needing this fix and I'd like to understand what is happening. Is there a registry key I can copy to reload it quickly? – Kevin S. Miller – 2016-10-21T12:38:59.233

New semester, different lab PC behaving the same way. Can anyone explain what the students may be doing to make this error happen? In this lab, the students have admin rights to do cyber security lab exercises - Not my preference, but that's what faculty wants. – Kevin S. Miller – 2017-02-02T13:32:31.773

psexec \192.168.1.103 -u computer_1\user2 -p pass1234 -c cmd – agelmarion – 2011-06-24T22:29:54.230

yes user is on remote pc, this still not working – agelmarion – 2011-06-24T22:30:56.520

i'm doing the same now, will put vmware on xp machine – agelmarion – 2011-06-24T22:34:14.443

Try with a user that has Administrator privileges, or use the option that lets you run a command as the SYSTEM account. Also I think you need to specify full path to the cmd.exe as in c:\windows\system32\cmd.exe. – LawrenceC – 2011-06-24T22:52:51.823

@ultrasawblade I think he meant cmd as "generic command". The -c switch copies the program in question to the computer, then executes it. In addition, you do not need to put the full path as long as the command is in the system path, for example in the system32 directory. – KCotreau – 2011-06-24T23:14:02.897

@ultrasawblade: psexec loads the user's profile, so %PATH% is always set. – user1686 – 2011-06-25T13:27:17.020

3

I'm not sure whether you're working on your own or part of a larger user domain. I had the same issue and resolved it as follows:

psexec \\REMOTEMACHINE -u DOMAIN\USERNAME ...

Basically, I prefaced my username with the domain name.

Isaac Kleinman

Posted 2011-06-24T22:16:02.260

Reputation: 489

1

You must ensure the time is synchronized throughout all the machines. If not, psexec will never work on Windows 7 and will report logon failure.

Vincent

Posted 2011-06-24T22:16:02.260

Reputation: 11

1

Even though this has already been answered, I thought i would post a quick test i just did with this same error / result.. As i might find it in google in a year or two when i forget.

Simply, trying the standard command as in the question above.. I got the same response.. But ..

If i mapped a network drive or browsed to the c$ share, this would then allow psexec to work...

So this might be a hack/shortcut around things allow for the required network auth on another level...

Angry 84

Posted 2011-06-24T22:16:02.260

Reputation: 111

1Very odd. I just encountered the same situation. The remote machine would refuse to authenticate me. I accessed the admin share via UNC path then ran the command again and it worked. – k1DBLITZ – 2015-12-23T16:29:16.907

1Trying to believe my own eyes but this did it for me. I was trying to use psexec on a 2016 server in Azure (after configuring proper ports). Beforehand, it was just simply telling me that my credentials were incorrect. – Jason Roner – 2018-12-31T20:42:13.810