Sysinternals Homepage
Forum Home Forum Home > Sysinternals Utilities > PsTools
  New Posts New Posts RSS Feed - Logon failure: unknown user name or bad p
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Logon failure: unknown user name or bad p

 Post Reply Post Reply Page  123 4>
Author
Message
scj6771 View Drop Down
Groupie
Groupie


Joined: 20 December 2006
Status: Offline
Points: 68
Post Options Post Options   Thanks (0) Thanks(0)   Quote scj6771 Quote  Post ReplyReply Direct Link To This Post Topic: Logon failure: unknown user name or bad p
    Posted: 20 December 2006 at 5:06pm

I am getting this error message everytime i run the following command both through PSExec GUI and PSExec through a command line.

psexec.exe \\computer name -u "admin" -p "password" -c "E:\PSTOOLS\UPDATE.vbs"

PsExec could not start UPDATE.vbs on "computer name":
Logon failure: unknown user name or bad password.

However I can open notepad on the same machine using PSExec so I know that psexec is working. can I not run a VBS file using psexec?

 

Back to Top
Karlchen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 June 2005
Location: Germany
Status: Offline
Points: 5131
Post Options Post Options   Thanks (0) Thanks(0)   Quote Karlchen Quote  Post ReplyReply Direct Link To This Post Posted: 21 December 2006 at 12:49am
Quote psexec.exe \\computer name -u "admin" -p "password" -c "E:\PSTOOLS\UPDATE.vbs"

This command line is highly unlikely to work for at least 2 reasons as explained below:
(1) Incorrect usage/omission of double quotes
(2) problematic absolute source path in -c option.

---
(1) Incorrect usage/omission of double quotes
You double quoted all the strings not holding any spaces, but did not quote "computer name".
Provided the real computername holds a space, either quote the name or use the IP-address instead.

---
(2) problematic absolute source path in -c option.

Has the target machine \\computer really got a drive E: and folder PSTOOLS?

I assume E:\PsTools only exists on your local machine and holds the vbs-script which you want to transfer to \\computer for remote execution.

The -c option is somewhat tricky with respect to path specifications, telling from my own limited experience with it.

I suggest you try this procedure:
e:

cd \pstools
:: rem now you are in the local folder holding the vbs file
psexec.exe \\computer -u admin -p password -c UPDATE.vbs


HTH,
Karl

Edited by Karlchen - 21 December 2006 at 1:00am
Back to Top
scj6771 View Drop Down
Groupie
Groupie


Joined: 20 December 2006
Status: Offline
Points: 68
Post Options Post Options   Thanks (0) Thanks(0)   Quote scj6771 Quote  Post ReplyReply Direct Link To This Post Posted: 21 December 2006 at 6:26am

Thanks for the reply, actually I only put the quotes in this post and not in the command itself, I have tried using the command you submitted but are now getting the error "The system cannot find the file specified". Not quite sure why, the vbs file is located in the same dir as pstools?

Also I have followed all the steps found in this post here http://forum.sysinternals.com/forum_posts.asp?TID=3698&P N=1&TPN=1

The problem I am having is when running this command: net use \\target\Admin$ /user:Administrator

I am getting a "Logon failure: unknown user name or bad password". error? it does prompt me for a password that I know is correct but still fails?



Edited by scj6771 - 21 December 2006 at 6:39am
Back to Top
Karlchen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 June 2005
Location: Germany
Status: Offline
Points: 5131
Post Options Post Options   Thanks (0) Thanks(0)   Quote Karlchen Quote  Post ReplyReply Direct Link To This Post Posted: 21 December 2006 at 6:40am
Hi.

(1) Are you sure, you were in "E:\PsTools" when you entered the psexec command line?
If you are not sure a simple "cd" will return the current location. It should return "E:\PsTools".

(2) Which file could not be found? Provided you were inside E:\Pstools, is psexec.exe located there, too?
Else there is a chance that this time psexec.exe was not found. - Are psexec.exe and update.vbs both located in E:\Pstools?

(3) Was psexec launched? If so the error message may have been returned by the remote machine.

(4) Instead of giving partial error message it would be much easier and more helpful to simply post a screenshot of the command window that shows where you are, what you did and which response you got.

(Just in case you did not know, you can simply mark everything inside a cmd.exe window and copy it to clipboard as pure text and then insert it in your reply here. )

Karl
Back to Top
scj6771 View Drop Down
Groupie
Groupie


Joined: 20 December 2006
Status: Offline
Points: 68
Post Options Post Options   Thanks (0) Thanks(0)   Quote scj6771 Quote  Post ReplyReply Direct Link To This Post Posted: 21 December 2006 at 6:51am

"(1) Are you sure, you were in "E:\PsTools" when you entered the psexec command line?
If you are not sure a simple "cd" will return the current location. It should return "E:\PsTools"."

Yes I am in e:\pstools

"(2) Which file could not be found? Provided you were inside E:\Pstools, is psexec.exe located there, too?
Else there is a chance that this time psexec.exe was not found. - Are psexec.exe and update.vbs both located in E:\Pstools?"

Yes psexec and update.vbs are both located inside pstools.

"3) Was psexec launched? If so the error message may have been returned by the remote machine."

Yes it looks like it starts to launch, if I look inside the event viewer on the target machine it states "the psexec service entered the running state". 

Back to Top
Karlchen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 June 2005
Location: Germany
Status: Offline
Points: 5131
Post Options Post Options   Thanks (0) Thanks(0)   Quote Karlchen Quote  Post ReplyReply Direct Link To This Post Posted: 21 December 2006 at 6:52am
I do not quite understand this contradiction:

In your first post you wrote you knew that psexec targetting \\computer worked (you could launch notepad).
But now you cannot do a "net use \\computer\Admin$ /user:Administrator"?

This brings me back to part (4) of my previous message. Else this may lead to a frustrating exchange of messages without ever finding a solution because I do not see what you see on your screen and keep on guessing.

As a first step to get a bit closer to a solution, please launch this command and let me now the exact response that you get back.

psexec.exe \\computer -u admin -p password cmd.exe

(Replace "computer" by the real computer name, "admin" by the real username, and "password" by the real password.)

If this command works then the following commands have got to work:
net use \\computer\Admin$ /user:admin password

net use \\computer\Admin$ /dele

(Replace "computer" by the real computer name, "admin" by the real username, and "password" by the real password.)
(The 2nd command only detaches from \\computer. It does not delete any file or folder.)

Karl
Back to Top
Karlchen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 June 2005
Location: Germany
Status: Offline
Points: 5131
Post Options Post Options   Thanks (0) Thanks(0)   Quote Karlchen Quote  Post ReplyReply Direct Link To This Post Posted: 21 December 2006 at 7:09am
Originally posted by scj6771 scj6771 wrote:

"3) Was psexec launched? If so the error message may have been returned by the remote machine."
Yes it looks like it starts to launch, if I look inside the event viewer on the target machine it states "the psexec service entered the running state".

Oh, good.
Looks like we can skip the steps suggested in my previous message and cut it short to this problem:

psexec.exe \\computer -u admin -p password -c UPDATE.vbs
would work fine, provided "update.vbs" were an executable file.
But it is not. It is just a text file associated to Windows scripting host.
This is why the remote machine issues a somewhat misleading error message.

So one correct way of remotely launching update.vbs is this:
psexec.exe \\computer -u admin -p password cmd.exe /c UPDATE.vbs

This would work provided ...

Stop. It will not in our case, because "update.vbs" is not located on the remote machine.
But as we have to prefix "cmd.exe /c" we can no longer use the -c option of psexec.

Hence we need to use a workaround:

e:

cd \pstools
:: transfer the script to \\computer
net use \\computer\C$ /user:admin password
copy update.vbs \\computer\C$\update.vbs

psexec.exe \\computer -u admin -p password cmd.exe /c C:\UPDATE.vbs

:: do some cleaning up
del \\computer\C$\update.vbs
net use \\computer\C$ /dele


Provided the current user on your local machine is the same as the "admin" user on \\computer the "net use" commands given above may be skipped (tried this here and it worked).

HTH,
Karl


Edited by Karlchen - 21 December 2006 at 7:13am
Back to Top
scj6771 View Drop Down
Groupie
Groupie


Joined: 20 December 2006
Status: Offline
Points: 68
Post Options Post Options   Thanks (0) Thanks(0)   Quote scj6771 Quote  Post ReplyReply Direct Link To This Post Posted: 21 December 2006 at 7:12am

"As a first step to get a bit closer to a solution, please launch this command and let me now the exact response that you get back."

Yes that seems to work it brings up to the following C:\WINDOWS\system32>

Then I enter the next command and is says that "The command completed successfully."

So you have to get "connected" by using the first command before the second command will work?

 

Back to Top
scj6771 View Drop Down
Groupie
Groupie


Joined: 20 December 2006
Status: Offline
Points: 68
Post Options Post Options   Thanks (0) Thanks(0)   Quote scj6771 Quote  Post ReplyReply Direct Link To This Post Posted: 21 December 2006 at 7:20am

Ok so far so good, everything is working up to this point, however, once I run the command in your "workaround" it gives me the following with a blinking cursor:

PsExec v1.73 - Execute processes remotely
Copyright (C) 2001-2006 Mark Russinovich
Sysinternals - www.sysinternals.com

 

Back to Top
Karlchen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 June 2005
Location: Germany
Status: Offline
Points: 5131
Post Options Post Options   Thanks (0) Thanks(0)   Quote Karlchen Quote  Post ReplyReply Direct Link To This Post Posted: 21 December 2006 at 7:30am
Oh no.

The copy command worked as intended? I.e. On the remote machine the file C:\update.vbs exists in the root folder of drive C:?

Any eventlog entries on the remote machine indicating a problem? Something about psexesvc perhaps?

--
Hm, what is update.vbs intended to do?

In case it creates graphical output and/or waits for any user input, any graphical stuff will only be visible on the remote machine.
Provided psexec has been launched using the -i option. (We did not use it.)

Reason:
psexec will show output from any remote console programme on your local machine. But it cannot transfer graphical output back to your local machine. (Simply was not designed to do so.)
--

Is the update.vbs visible inside the process list on the remote machine?

Karl



Edited by Karlchen - 21 December 2006 at 7:42am
Back to Top
 Post Reply Post Reply Page  123 4>
  Share Topic   

Forum Jump Forum Permissions View Drop Down