It would probably help others help you if you could tell us how
it is failing to do what you expect.
Graham.
On Mon, Apr 02, 2001 at 02:48:14PM -0500, Edgington, Jeffrey wrote:
> Ok... I'm hoping someone has already done this and can tell me what I have
> wrong... I want to reset passwords via Net::LDAPS (LDAP over SSL) but having
> little luck with it.
>
> Below is the code as it stands now.... thanks for any help you can give me.
>
>
> #!/umr/testbin/perl
>
> $| =1;
>
> use Convert::BER;
> use Net::LDAPS;
>
> $ldaps = new Net::LDAPS('srvtst01.cc.umr.edu',
> port=> '636');
>
>
> $UserPass="94ranger";
> $UserID="Administrator";
> $ADSserver='srvtst01.cc.umr.edu';
> $DomainDN=" dc=test, dc=umr, dc=edu";
> $UserDN="cn=$UserID, cn=users, " . $DomainDN;
>
> $ldaps = Net::LDAPS->new($ADSserver) || die "failed: $@";
>
> $mesg = $ldaps->bind( dn =>"$UserDN", password => "$UserPass" );
> $mesg->code && die "bind failed: $mesg->error";
>
> $tempDN = "cn=Test2 Edg, cn=Users, " . $DomainDN;
>
>
> $pwd = new Convert::BER;
>
> $pwd->encode(
> STRING=>"hello",
> ) or die;
>
> $mesg = $ldaps->modify(dn => $tempDN,
> changes => [
> replace => [ unicodePwd => "$pwd"]
> ]
> );
>
> $mesg->code && die "failed: $mesg->error";
>
>
>
>
>
>
>
>
>
|