Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a list of user accounts that need their password reset to a default password (also users will be required to change the password at first login). Is there a way to reset the password for a list of Active Directory users en-mass? I'd rather not use any third party software. Can I do this in dsa.exe? Or can this be done with a power-shell script? I've seen some examples that reset the passwords for all users in an OU but this will not work for me. I need to reset the passwords for only 50 of 300 users in the same OU.

share|improve this question

3 Answers 3

If all accounts are to be reset to the same password, you could probably do something like this:

for /f %%u in (users.txt) do @net user %%u PASS /logonpasswordchg:yes /domain
share|improve this answer

Yup.

You can loop and read in the names of the accounts you need to reset from a .csv of the usernames, which you hopefully already have in a list somewhere.

If you have the AD module for PowerShell, it's even easier (you can also read in a .csv of the usernames with this method, instead of using a filter).

First, you need to import ActiveDirectory Module

Import-Module ActiveDirectory

Second, generate a SecureString which contains the password.

$securePwd = ConvertTo-SecureString -String "P@ssw0rd!" -Force -AsPlainText

Third, find the Active Directory users ,and use Set-ADAccountPassword for resetng the password.

Get-ADUser -Filter {Name -like "Test"} | Set-ADAccountPassword -NewPassword $securePwd*

Also, you can review following link for more details about the Active Directory cmdlets.

Active Directory Cmdlets in Windows PowerShell

http://technet.microsoft.com/en-us/library/ee617195.aspx

share|improve this answer

This question is already been discussed at the community before. Please refer to this link

How do I bulk reset passwords for all users in an OU?

and you can go for this link also Mass password change at active directory

http://blog.scottlowe.org/2005/12/08/mass-password-changes-in-active-directory/

ELse go for a freeware tool such as Lepide Active Directory Self service. It will allow you to change the password for limitation up to 50 users.

share|improve this answer
    
The question specifically states that the users are not all in the same OU. How does the other question you linked relate to this one, then? –  Adrian Lang Nov 22 '12 at 12:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.