How to use a VBS script to mass change user passwords

I have just migrated from NT4 to windows 2003. I have moved over 400 users into an OU called users and want to mass change all their passwords to Password1. I have looked at a few VBS scripts but am having trouble with them. Any help would be appreciated?

Thanks!

Michael
LVL 1
LuxtechAsked:
Who is Participating?
 
Computer101Connect With a Mentor Commented:
PAQed with points refunded (250)

Computer101
EE Admin
0
 
Chris DentPowerShell DeveloperCommented:

Here we go... nice and little. You'll need to fill in the password and the path for the OU. This is based on the domain name being yourdomain.local so alter as applicable.


Set objOU = GetObject("LDAP://OU=SomeOU,OU=SomeWhere,DC=YourDomain,DC=local")
objOU.Filter = Array("user")

For Each objUser in objOU
      objUser.SetPassword "NewPassword1"
Next


And that's all there is to it unless they're in sub-OUs and such.

HTH

Chris
0
 
LuxtechAuthor Commented:
Hi Chris

I am still having problems with this, I am getting an error on the script that sys:

line: 1
char: 1
Error: A referral was returned from the server.
code: 8007202b
source: (null)

I have changed the obj names to the users ou.

Thanks
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
Chris DentPowerShell DeveloperCommented:

Oh they're in the default Users OU? That one isn't really an OU (for whatever reason MS decided) it should be:

Set objOU = GetObject("CN=Users,DC=YourDomain,DC=local")

After that it can be treated in exactly the same way as above.

Chris
0
 
LuxtechAuthor Commented:
Hi Chris

Thanks for your help but I used AD infinitum to mass change everyones password which worked fine.

I appreciate your time looking into this for me!

Take care

Michael
0
 
Chris DentPowerShell DeveloperCommented:

No problem.

Chris
0
All Courses

From novice to tech pro — start learning today.