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 13992 times)

0 Members and 1 Guest are viewing this topic.

Arotin

    Topic Starter


    Rookie

    • Experience: Beginner
    • OS: Windows 7
    Authentication problem net user/psexec
    « on: January 29, 2016, 03:29:51 PM »
    Hello,

    im having an issue with my batch script im not sure what im doing wrong..  when i run it i get the error from psexec saying : unknown username or bad password


    for /f %%F in (C:\pclist.txt) do (
    pstools\psexec.exe \\%%F -u Admin -p Pass net user Admin NewPass
    )
    pause


    its weird because if i do not include the "-p Pass" then it will ofcourse ask me for a password.. i put the password in and it SOMETIMES works. lol

    basically im trying to change the local admin account password of all the computers on my work network.. some are on domain some are not. this technically SHOULD work...


    Please Advise,

    Thank you,
    Arotin


    Arotin

      Topic Starter


      Rookie

      • Experience: Beginner
      • OS: Windows 7
      Re: Authentication problem net user/psexec
      « Reply #1 on: January 29, 2016, 03:57:05 PM »
      before anyone says if im putting in the correct password... yes i promise, i triple checked (:

      Squashman



        Specialist
      • Thanked: 134
      • Experience: Experienced
      • OS: Other
      Re: Authentication problem net user/psexec
      « Reply #2 on: January 29, 2016, 04:36:16 PM »
      Well then I will ask the next most obvious question. Why are you not using PSPASSWD?

      Arotin

        Topic Starter


        Rookie

        • Experience: Beginner
        • OS: Windows 7
        Re: Authentication problem net user/psexec
        « Reply #3 on: January 29, 2016, 04:59:12 PM »
        Well then I will ask the next most obvious question. Why are you not using PSPASSWD?

        Every single time i have tried pspasswd, nothing happens. it just gives me the syntax..

        example of my code for pspasswd

        Code: [Select]
        for /f %%F in (PCLIST.txt) do (
        pspasswd.exe \\%%F -u administrator -p Password administrator NewPassword
        )


        So using the psexec in combination with net user actually gets me a step further..


        thanks

        foxidrive



          Specialist
        • Thanked: 268
        • Experience: Experienced
        • OS: Windows 8
        Re: Authentication problem net user/psexec
        « Reply #4 on: January 29, 2016, 11:04:02 PM »
        Every single time i have tried pspasswd, nothing happens. it just gives me the syntax..

        Code: [Select]
        for /f %%F in (PCLIST.txt) do (
        pspasswd.exe \\%%F -u administrator -p Password administrator NewPassword
        )

        Put an echo statement before pspasswd.exe and pause on the next line, and you will see the command being used.  There will be an error in it.

        Squashman



          Specialist
        • Thanked: 134
        • Experience: Experienced
        • OS: Other
        Re: Authentication problem net user/psexec
        « Reply #5 on: January 29, 2016, 11:29:08 PM »
        Every single time i have tried pspasswd, nothing happens. it just gives me the syntax..

        example of my code for pspasswd

        Code: [Select]
        for /f %%F in (PCLIST.txt) do (
        pspasswd.exe \\%%F -u administrator -p Password administrator NewPassword
        )


        So using the psexec in combination with net user actually gets me a step further..


        thanks
        Why are you using the FOR command to get the computer name when PSPASSWD and PSEXEC for that matter have an option to specify a file that has a list of computer names?

        Arotin

          Topic Starter


          Rookie

          • Experience: Beginner
          • OS: Windows 7
          Re: Authentication problem net user/psexec
          « Reply #6 on: February 01, 2016, 10:02:03 AM »
          Why are you using the FOR command to get the computer name when PSPASSWD and PSEXEC for that matter have an option to specify a file that has a list of computer names?

          what? im using the FOR command to go thro a list of ip addresses in that "PCLIST" and do them 1 by 1, and why does it matter? that has nothing to do with my question???

          Arotin

            Topic Starter


            Rookie

            • Experience: Beginner
            • OS: Windows 7
            Re: Authentication problem net user/psexec
            « Reply #7 on: February 01, 2016, 10:11:11 AM »
            Put an echo statement before pspasswd.exe and pause on the next line, and you will see the command being used.  There will be an error in it.


            Tried that, same thing. no errors.. just the syntax.

            Squashman



              Specialist
            • Thanked: 134
            • Experience: Experienced
            • OS: Other
            Re: Authentication problem net user/psexec
            « Reply #8 on: February 01, 2016, 12:07:44 PM »
            what? im using the FOR command to go thro a list of ip addresses in that "PCLIST" and do them 1 by 1, and why does it matter? that has nothing to do with my question???
            Well I guess I am just trying to explain to you how to do it with LESS code or maybe a different way to do it that might work.  The code will execute much quicker if you use the @file option.  But I guess it is a mute point if you can't get any of them to run.

            Arotin

              Topic Starter


              Rookie

              • Experience: Beginner
              • OS: Windows 7
              Re: Authentication problem net user/psexec
              « Reply #9 on: February 01, 2016, 12:10:15 PM »
              Well I guess I am just trying to explain to you how to do it with LESS code or maybe a different way to do it that might work.  The code will execute much quicker if you use the @file option.  But I guess it is a mute point if you can't get any of them to run.


              Okay i will try that way and report back to this post. thank you.

              Squashman



                Specialist
              • Thanked: 134
              • Experience: Experienced
              • OS: Other
              Re: Authentication problem net user/psexec
              « Reply #10 on: February 01, 2016, 12:38:55 PM »
              If you still cannot get the commands to run successfully, I suggest you post a message on the Sysinternal Forum.
              http://forum.sysinternals.com/sysinternals-utilities_forums_cat2.html

              Just a quick question. What operating system are the remote computers?
              You do realize there are prerequisites for the remote computer for any of the PSTOOLS to work.

              Arotin

                Topic Starter


                Rookie

                • Experience: Beginner
                • OS: Windows 7
                Re: Authentication problem net user/psexec
                « Reply #11 on: February 01, 2016, 12:52:02 PM »
                If you still cannot get the commands to run successfully, I suggest you post a message on the Sysinternal Forum.
                http://forum.sysinternals.com/sysinternals-utilities_forums_cat2.html

                Just a quick question. What operating system are the remote computers?
                You do realize there are prerequisites for the remote computer for any of the PSTOOLS to work.


                They are all windows 7, some 32 and most 64. but its gives problems on both. all firewalls are turned off, and all of them are win7 pro and have their built in administrator account enabled (which is the account i want to change the passwords for)

                I tested with the @file option and same thing.


                thanks

                foxidrive



                  Specialist
                • Thanked: 268
                • Experience: Experienced
                • OS: Windows 8
                Re: Authentication problem net user/psexec
                « Reply #12 on: February 02, 2016, 12:43:02 AM »
                Tried that, same thing. no errors.. just the syntax.

                You won't get the syntax if you do what I outlined.

                Code: [Select]
                for /f %%F in (PCLIST.txt) do (
                echo pspasswd.exe \\%%F -u administrator -p Password administrator NewPassword
                pause
                )
                « Last Edit: February 02, 2016, 12:58:28 AM by foxidrive »

                Arotin

                  Topic Starter


                  Rookie

                  • Experience: Beginner
                  • OS: Windows 7
                  Re: Authentication problem net user/psexec
                  « Reply #13 on: February 03, 2016, 05:27:51 PM »
                  You won't get the syntax if you do what I outlined.

                  Code: [Select]
                  for /f %%F in (PCLIST.txt) do (
                  echo pspasswd.exe \\%%F -u administrator -p Password administrator NewPassword
                  pause
                  )


                  All that did was echo the command onto the command line, i copy pasted the code you provided and change the passwords to the proper ones.

                  Arotin

                    Topic Starter


                    Rookie

                    • Experience: Beginner
                    • OS: Windows 7
                    Re: Authentication problem net user/psexec
                    « Reply #14 on: February 03, 2016, 06:37:07 PM »
                    I tried taking out the -u and -p switches, and running it as administrator , and that seemed to work. is there a reason why i cannot provide alternate credentials ?

                    PS the user and password i was providing is the same as the local admin im running the script from. so im very confused as to why its doing that.



                    thanks