The password attribute in Active Directory is unicodePwd (in objectClass securityPrincipal) and not userPassword. Note that you can only perform LDAP operations on unicodePwd if SSL is being used.
-----Original Message----- From: Hollinger, Robert-Alexandre [mailto:[EMAIL PROTECTED] Sent: 15 April 2004 13:49 To: [EMAIL PROTECTED] Subject: Problems with creating a user password Hello everyone, I'm trying to create a new user. It is disabled, but I managed to enable him by setting his 'userAccountControl' to 544. I also want to change his password which is an empty one by default. But I really cannot find how to do this with Net::LDAP and PERL. I tried the following : my $newentry = Net::LDAP::Entry->new; my $dn="cn=cmoreno,ou=Users,ou=rahtest,dc=XXX,dc=XXX,dc=XXX"; $newentry->add('cn' => 'cmoreno'); $newentry->dn("$dn"); $newentry->add('displayName' => 'Chino Moreno'); $newentry->add('sn' => 'moreno'); $newentry->add('sAMAccountName' => 'cmoreno'); $newentry->add('mail' => '[EMAIL PROTECTED]'); $newentry->add('userPrincipalName' => 'cmoreno'); $newentry->add('givenName' => 'Chino'); $newentry->add('userPassword' => 'azerty-4-4); $newentry->add('objectclass' => 'user'); my $mesg = $ldap->add($newentry); $newentry->update($ldap); Can anyone help me please? Robert-Alexandre Hollinger
