2013年5月3日星期五

Reset a user password Active Directory (AD) by using command

1. Open Command Prompt.



2. Type:

dsmod userUserDN-pwdNewPassword

3. If you want to require the user to change this password at the next logon process, Type:

dsmod userUserDN-mustchpwd {yes|no}


UserDN: Specifies the distinguished name of the user for which the password will be reset.

NewPassword: Specifies the password that will replace the current user password.


Examples:
To reset a user's password:


dsmod user "CN=John Doe,CN=Users,DC=microsoft,DC=com"
-pwd A1b2C3d4 -mustchpwd yes

To reset multiple user passwords to a common password

and force them to change their passwords the next time they logon:

dsmod user "CN=John Doe,CN=Users,DC=microsoft,DC=com"
"CN=Jane Doe,CN=Users,DC=microsoft,DC=com" -pwd A1b2C3d4 -mustchpwd yes

To disable multiple user accounts at the same time:

dsmod user "CN=John Doe,CN=Users,DC=microsoft,DC=com"
"CN=Jane Doe,CN=Users,DC=microsoft,DC=com" -disabled yes


ref: http://techtoy-blog.blogspot.hk/2010/06/reset-user-password-active-directory-ad.html