Using a Batch File for Resetting Domain Passwords

  • Section(s): Active Directory , Admin
  • Created on Feb 08, 2006.
  • Last Modified on Mar 02, 2006.
  • Last Modified by Chris Sanders.
  • Rated 4.1 out of 5 based on 15 votes.
Occasionally someone in your organization will need to be able to reset passwords of others without having access to active directory. This can be achieved with a simple batch file…

In some organizations the need may arise for a member of staff to be able to reset passwords for users without having to access the Active Directory users and computers snap-in. One solution for this is to setup a batch file that will allow the staff member to do this in an automated fashion. This can be accomplished by using the often underestimated NET command.

The following file named “pwreset.bat” will do exactly what we wish to accomplish:

@echo off
SET /P usr=Please enter the username you wish to reset the password for:
net user %usr% * /DOMAIN

Once you run pwreset.bat the file prompts the staff member for the username of the account they wish to reset. After this it prompts for what the password should be set to, then requests the password be typed a second time for confirmation purposes. Once this is done the user account is updated on the domain controller and you are good to go!

***

Chris Sanders is the network administrator for one of the largest public school systems in the state of Kentucky. Chris's specialties include general network administration, windows server 2003, wireless networking, and security. You can view Chris' personal website at www.chrissanders.org.

Article not looking right or info is missing? Let us know so that we can fix it: .


Receive all the latest articles by email!

Receive Real-Time & Monthly WindowsNetworking.com article updates in your mailbox. Enter your email below!
Click for Real-Time sample & Monthly sample

Become a WindowsNetworking.com member!

Discuss your network issues with thousands of other network administrators. Click here to join!

Community Area

Log in | Register

Readers' Choice

Which is your preferred Anti Virus Appliance solution?