Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Authentication problem net user/psexec  (Read 13990 times)

0 Members and 1 Guest are viewing this topic.

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Authentication problem net user/psexec
« Reply #15 on: February 03, 2016, 08:21:09 PM »
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.  :)

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: Authentication problem net user/psexec
« Reply #16 on: February 03, 2016, 11:29:20 PM »
It's a sysinternals tool, and as Microsoft bought Sysinternals some time ago, I guess it would count as the latter.
I was trying to dereference Null Pointers before it was cool.

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: Authentication problem net user/psexec
« Reply #17 on: February 03, 2016, 11:40:14 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.

Arotin

    Topic Starter


    Rookie

    • Experience: Beginner
    • OS: Windows 7
    Re: Authentication problem net user/psexec
    « Reply #18 on: February 04, 2016, 10:28:44 AM »
    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,

    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: Authentication problem net user/psexec
    « Reply #19 on: February 04, 2016, 11:25:27 AM »
    Oops.  [deleted]

    :)

    Arotin

      Topic Starter


      Rookie

      • Experience: Beginner
      • OS: Windows 7
      Re: Authentication problem net user/psexec
      « Reply #20 on: February 04, 2016, 12:08:01 PM »
      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.

      patio

      • Moderator


      • Genius
      • Maud' Dib
      • Thanked: 1769
        • Yes
      • Experience: Beginner
      • OS: Windows 7
      Re: Authentication problem net user/psexec
      « Reply #21 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.
      " Anyone who goes to a psychiatrist should have his head examined. "

      Arotin

        Topic Starter


        Rookie

        • Experience: Beginner
        • OS: Windows 7
        Re: Authentication problem net user/psexec
        « Reply #22 on: February 04, 2016, 12:19:34 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...

        patio

        • Moderator


        • Genius
        • Maud' Dib
        • Thanked: 1769
          • Yes
        • Experience: Beginner
        • OS: Windows 7
        Re: Authentication problem net user/psexec
        « Reply #23 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.

        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.
        " Anyone who goes to a psychiatrist should have his head examined. "

        Squashman



          Specialist
        • Thanked: 134
        • Experience: Experienced
        • OS: Other
        Re: Authentication problem net user/psexec
        « Reply #24 on: February 04, 2016, 01:50:30 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.

        Squashman



          Specialist
        • Thanked: 134
        • Experience: Experienced
        • OS: Other
        Re: Authentication problem net user/psexec
        « Reply #25 on: February 04, 2016, 01:52:33 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.log

        Arotin

          Topic Starter


          Rookie

          • Experience: Beginner
          • OS: Windows 7
          Re: Authentication problem net user/psexec
          « Reply #26 on: February 04, 2016, 02:01:38 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" .



          patio

          • Moderator


          • Genius
          • Maud' Dib
          • Thanked: 1769
            • Yes
          • Experience: Beginner
          • OS: Windows 7
          Re: Authentication problem net user/psexec
          « Reply #27 on: February 04, 2016, 02:07:17 PM »
          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...
          " Anyone who goes to a psychiatrist should have his head examined. "

          Arotin

            Topic Starter


            Rookie

            • Experience: Beginner
            • OS: Windows 7
            Re: Authentication problem net user/psexec
            « Reply #28 on: February 04, 2016, 02:58:04 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.