Solved

How to use a VBS script to mass change user passwords

Posted on 2006-10-26
7
234 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 71

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 71

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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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 71

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

724 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