I am attempting to use Net::LDAPS so I can change Active Directory passwords (from an 
earlier posting), but when I use "new" constructor, nothing is returned to my $ldaps 
variable. When I run the script using "Net::LDAP" instead of "Net::LDAPS", the LDAP 
hash is printed. Shouldn't "new Net::LDAPS" return a hash?

use Net::LDAPS;

$ldaps = new Net::LDAPS('myserver.example.com');
print "LDAPS:$ldaps\n";



Dan Swanson
Programmer / Analyst / System Admin
George Fox University
503.554.2576


-----Original Message-----
From: Christopher A Bongaarts [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 01, 2003 12:45 PM
To: Dan Swanson
Cc: [EMAIL PROTECTED]
Subject: Re: Password change in LDAP


In the immortal words of Dan Swanson:

> I have a Perl script using Net::LDAP to create new accounts in
> Microsoft Active Directory. Everything is working well except the
> password change (see output below). I am attempting to perform a
> ldap->modify(replace) which works well for other attributes, but not
> the password. I am getting a LDAP_UNWILLING_TO_PERFORM error. Has
> anyone encountered this error before?

AD requires that the connection be secure (LDAPS) and uses a specific
format for the password.  If your password is in $password, this
should do it for you:

  $newpassword = pack "v*", unpack "C*", qq("$password");

(It must be enclosed in literal double quotes, then put in UTF-16(?)
form.)

%%  Christopher A. Bongaarts  %%  [EMAIL PROTECTED]       %%
%%  Internet Services         %%  http://umn.edu/~cab  %%
%%  University of Minnesota   %%  +1 (612) 625-1809    %%

Reply via email to