Re: [Net::LDAP] Re: How To Set AD Password

Peter Karman <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.ldap
Message-ID <[email protected]>
Christopher A Bongaarts wrote on 12/31/09 1:44 PM:
> In the immortal words of Sheahan, John:
> 
>> My script is successfully creating AD and Exchange accounts but I'm having trouble setting the password.
>>
>> I am setting these attributes:
>>
>>                                   'userPassword' => 'password',
>>                                   'userAccountControl' => '66048',  # activates the account and sets the password to never expire
>>
>>
>> For some reason, the password is not being set but my script does not throw an error.
> 
> Not sure why you're not seeing an error, but normally the userPassword
> needs special encoding (UTF16 and quotation marks) and has other rules
> associated with it (only settable on an SSL connection, e.g.) - search
> the list archives/web for the details.

you can see one implementation of setting a AD password, based on the list 
archives, in Net::LDAP::Class::User::AD on CPAN. Look at the source for the 
password() method and the private methods for encoding/decoding the string.


-- 
Peter Karman  .  http://peknet.com/  .  [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.