I am trying to run a batch script which requires a domain administrator account, so i am using the Windows Run As: domain/username and then password.

For some reason though, the script will not run. It says that it is Completed Successfully, but nothing is happening on the computer.

The script itself is suppose to change the user's domain password, and then force a restart.

net user user_name password /DOMAIN
shutdown -r -t 00

Any clue what is going on?
Answer Summary:
2 Comments   [ - ] Hide Comments


  • Does the batch file work if you run it manually from a command prompt?

    Perhaps try adding some echo and pipe commands to hopefully pin down where it is failing.
    echo user_name >>c:\temp\some.log
    net user user_name password /DOMAIN >>c:\temp\some.log
    echo password change done >>c:\temp\some.log
    shutdown -r -t 00 >>c:\temp\some.log
    echo shutdown done >>c:\temp\some.log
    • If I run it through the computer I get an access denied error. See, I need the script to run remotely on accounts that don't have domain administrator privileges.
  • That worked SMal! Thanks very much for the assistance!
Please log in to comment

Answer this question or Comment on this question for clarity


Why do you not just login as a domain admin and open a command window on your admin station and change the users password that way?  Then issue a restart to that users computer from the cmd window using shutdown with the /m option
net user user_name password /DOMAIN
Answered 08/19/2014 by: SMal.tmcc
Red Belt

  • Changing the password via Active Directory then running a logout script is a workable option. I would of just preferred to do it all in one script if possible.
    • How are you running this?

      with cmd.exe as the application and net use is a parameter or with net.exe as the application?
      • I was just running a batch file through Kace. The Run a program command. Then I realized they have a run batch file option within Kace. So I put the code I posted in there instead.
    • another way to run this so it works is to target your system (be logged in as a domain admin). Just make sure you add the /m so you shutdown their machine not yours.
      • Target my system? How would the script then run on theirs, like i need it to?
      • It does not need to run on theirs, It just needs to run on an admins machine in the domain of the user you want to change the pw for. The pw change occurs on the DC not the local machine since you are using the /domain switch. So you can run the script on your admin station and the net user command is passed to the DC. The /m switch in the shut down will redirect the command to that machine
Please log in to comment
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja