I did this some time ago. Hope it helps.
http://dennisitpro.spaces.live.com/blog/cns!66E6F2EEAC5B826B!284.entry
Grabbing every user in an OU and reset their password
I was just being asked casually if this is possible.
She wanted to use a script, grab all the user accounts in the OU and reset their password to something, then output the list to a prompt. And i took up my keyboard (instead of a pen) and started this simple task for her. (Hey, this earned me a lunch date with a lady ok?)
Anyway, there are the codes.
=================================================================
dim OutPutList
dim Password
ObjOU.Filter = Array("User")
OutputList = ""
Password = "PassW0rd" 'I simply preset the password to something. You can change this accordingly
For Each objUser in ObjOU
'If you want to have random password, call a function to randomize a password before you call the SetPassword method
objUser.SetPassword Password
OutputList = Outputlist & objUser.Name & " - " & password & vbcrlf
Next
Wscript.echo OutputList
'Prompts out what is the list on screen. You can replace this with a script to output to file
================================================================
Save the codes to a .vbs, change the LDAP string.
To save the output to a file, use this command "cscript script.vbs /Nologo >> Results.txt"
Use notepad and open the Results.txt, should work.
Dennis Chung | IT Pro Evangelist | Microsoft Singapore
http://pingdennis.com