From: Glen Holcomb Date: 2007-08-28T00:18:49+09:00 Subject: Re: Changing/Setting Passwords in Active Directory ------=_Part_84466_1340302.1188227927522 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/27/07, Glen Holcomb wrote: > > I've been doing some searching but am not faring so well. > > Does anyone know a clean and reliable way to change and or set passwords > for > Windows accounts residing in Active Directory? > > I'd rather not have to generate a VB script to be run for every user > account > created. > > Thanks, > Glen > > -- > "Hey brother Christian with your high and mighty errand, Your actions > speak > so loud, I can't hear a word you're saying." > > -Greg Graffin (Bad Religion) > I think I'm close but something is not working somewhere. This seems to be the most promising approach but doesn't work: require 'win32ole' require 'Win32API' adsi = WIN32OLE.connect("LDAP://cn=#{username},PATH_TO_CONTAINER") adsi.put("SetPassword", "#{password}") this returns nil adsi.invoke("SetPassword", "#{password}") this returns the string given as the password but nothing is changed The following VB script works just fine: Set objUser = GetObject _ ("LDAP://my values here") objUser.SetPassword "some password" -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) ------=_Part_84466_1340302.1188227927522--