Solved

How to use a VBS script to mass change user passwords

Posted on 2006-10-26
7
231 Views
Last Modified: 2010-04-18
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
0
Comment
Question by:Luxtech
  • 3
  • 2
7 Comments
 
LVL 70

Expert Comment

by:Chris Dent
ID: 17811941

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
 
LVL 1

Author Comment

by:Luxtech
ID: 17817803
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
 
LVL 70

Expert Comment

by:Chris Dent
ID: 17817985

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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 1

Author Comment

by:Luxtech
ID: 17818015
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
 
LVL 70

Expert Comment

by:Chris Dent
ID: 17818018

No problem.

Chris
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18016089
PAQed with points refunded (250)

Computer101
EE Admin
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The HP utility "HP Lights-Out Online Configuration Utility for Windows Server 2003/2008" could be of great use when it comes to remotely configure a HP servers ILO WITHOUT rebooting the server. We would only need to create and run scripts using thi…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question