1.

Solve : Authentication problem net user/psexec?

Answer»

Question.
Is the pspasswd.exe part of a third party tool kit?
Or is it an optional tool from Microsoft?
Curious minds need to know.
It's a sysinternals tool, and as Microsoft bought Sysinternals some time ago, I guess it would count as the latter.Quote from: Arotin on February 03, 2016, 05:27:51 PM

All that did was echo the command onto the command line

That's precisely the point of it.

pspassword was printing the message because there was an error in the command line, and we can't see the command line or the message that was printed to the console - so you have to figure it out by examining everything.

If it's a permissions issue: then if you right click the code you had originally and select run as administrator then it should work as it is. This is another debugging step.Quote from: foxidrive on February 03, 2016, 11:40:14 PM
That's precisely the point of it.

pspassword was printing the message because there was an error in the command line, and we can't see the command line or the message that was printed to the console - so you have to figure it out by examining everything.

If it's a permissions issue: then if you right click the code you had originally and select run as administrator then it should work as it is. This is another debugging step.

Alright thanks, ill try each step and see where its faulty.

thank you sir,Oops. [deleted]

So here is what i got so far,

I have tried taking out the -u and -p switches, and just running it on a administrator profile(which i was originally). i am testing on two machines; one is joined to DOMAIN and one is not.

the one that is not, it changes the password and i can use that password to log into the local admin just fine.
the one that is joined to domain the script will change the password and exit with error code 0, BUT when i try to login with the new password it doesnt work and the old one doesnt work either..

does that make sense? LOL

Code: [Select]@echo off

setlocal enabledelayedexpansion

for /f %%F in (C:\PCLIST.txt) do (
pstools\psexec.exe \\%%F net user Administrator NewPassword123!
if !errorlevel! NEQ 0 echo %%F >> Failed.log
)
echo complete
pause


any ideas? thanks.

PS. no im not using pspasswd its the worst creation since trump k thx.
Then you don't have elevated privelidges for the domain...just the ones who aren't.

And i don't even do batch...so i'll leave it to the experts we have.Quote from: patio on February 04, 2016, 12:13:30 PM
Then you don't have elevated privelidges for the domain...just the ones who aren't.

And i don't even do batch...so i'll leave it to the experts we have.

im running the bat as local admin account to change the local admin password. im not sure what you mean by that; so if i run the batch script as domain admin then it will use the domain admin CREDENTIALS to connect to the machine but will it change the domain password? i dont want that...I'm simply stating you may need domain credentials to make any changes to PC's in the domain...simple as that.

As i said i'm no batch expert i'll leave that to others...so i can't speak to what level changes your bat would make.Quote from: patio on February 04, 2016, 12:57:06 PM
I'm simply stating you may need domain credentials to make any changes to PC's in the domain...simple as that.
I would tend to agree with that.Quote from: Arotin on February 04, 2016, 12:08:01 PM
Code: [Select]@echo off

setlocal enabledelayedexpansion

for /f %%F in (C:\PCLIST.txt) do (
pstools\psexec.exe \\%%F net user Administrator NewPassword123!
if !errorlevel! NEQ 0 echo %%F >> Failed.log
)
echo complete
pause
Did you really try to use an exclamation in the password with delayed expansion enabled?

Pretty sure you could have just kept delayed expansion off and did this instead.

Code: [Select]if errorlevel 1 echo %%F >> Failed.logQuote from: Squashman on February 04, 2016, 01:52:33 PM
Did you really try to use an exclamation in the password with delayed expansion enabled?

Pretty sure you could have just kept delayed expansion off and did this instead.

Code: [Select]if errorlevel 1 echo %%F >> Failed.log

okay so should i take off delayed expansion and try running the batch with domian admin credentials? but as long as i do not specify the domain in the script then it wont modify the domain account correct? i only want to change the local admin password.

and as far as the errorcode, why is mine incorrect lol. there could be more error codes besides "1" .


Quote
okay so should i take off delayed expansion and try running the batch with domian admin credentials? but as long as i do not specify the domain in the script then it wont modify the domain account correct? i only want to change the local admin password.

This is why you need to have a test PC...select 1 in the domain to test the code...but i'd fix the GLITCHES 1st...Quote from: patio on February 04, 2016, 02:07:17 PM
This is why you need to have a test PC...select 1 in the domain to test the code...but i'd fix the glitches 1st...

i have 3 test PCs. 2 are the ones receiving and one is for running the bat file, yeah im going to make some changes and report back with results.


thanks.


Discussion

No Comment Found