public function resetPassword($dn, $password)
    {
        try {
            $this->update(
                $dn,
                ['unicodePwd' => iconv('UTF-8', 'UTF-16LE', sprintf('"%s"', $password))]
            );
        } catch(\Zend\Ldap\Exception\LdapException $e) {
            throw new Exception($this->getLastPasswordError());
        }
    }
public function resetPassword($dn, $password)
    {
        try {
            $this->update(
                $dn,
                ['unicodePwd' => iconv('UTF-8', 'UTF-16LE', sprintf('"%s"', $password))]
            );
        } catch(\Zend\Ldap\Exception\LdapException $e) {
            throw new Exception($this->getLastPasswordError());
        }
    }
public function resetPassword ( $ dn , $ password ) { try { $ this -> update ( $ dn , [ 'unicodePwd' => iconv ( 'UTF-8' , 'UTF-16LE' , sprintf ( '"%s"' , $ password ) ) ] ) ; } catch ( \ Zend \ Ldap \ Exception \ LdapException $ e ) { throw new Exception ( $ this -> getLastPasswordError ( ) ) ; } }
Administrative password reset.

This is different to password change - it does not require old password, but also
it does not respect password history policy setting.

@param string $dn Location to update the entry at.
@param string $password New password to set.
@throws \Zend\Ldap\Exception\LdapException
Administrative password reset .