title: LDAP CHANGE PASSWORD PHP
body: <p>I want to change user's password [unicodePwd] on Windows Active Directory using PHP LDAP.</p>
  
  <p>I am using Windows Active Directory via PHP LDAP.</p>
  
  <p>I don't have any issues connection to it.</p>
  
  <p>I don't have any issues collecting data.</p>
  
  <p>I don't have any issues changing attributes using ldap_mod_replace or ldap_modify</p>
  
  <p>except for the "unicodePwd".</p>
  
  <p>*note that this works</p>
  
  <pre><code>$user['telephonenumber'] = '1234567890';
  </code></pre>
  
  <p>*note that this does'nt work</p>
  
  <pre><code>$user['unicodePwd'] = mb_convert_encoding('my_new_password', "UTF-16LE");
  </code></pre>
  
  <p>// CODE</p>
  
  <pre><code>$result = ldap_modify($ldap, $dn, $user);
  return ldap_error($ldap);
  </code></pre>
  
  <p>// CODE</p>
  
  <p>// ERROR ON CHANGING unicodePwd</p>
  
  <pre><code>ldap_modify(): Modify: Server is unwilling to perform
  </code></pre>
  
  <p>// NO ERROR FOR telephonenumber</p>
  
  <ul>
  <li>06/11/2018 Problem,</li>
  </ul>
  
  <p>I can't setup my server to have ldap over ssl.
  Already tried installing AD CS, nothing worked so far. Still configuring my server any idea about installing CA(Certificate Authority) to be used in LDAP over SSL?</p>
  
  <ul>
  <li>06/20/2018 Problem, NEW PROBLEM</li>
  </ul>
  
  <p>Already setup LDAP OVER SSL, i can also use ldap using the</p>
  
  <p>cmd->ldp; port 389, and 636 with ssl is good.</p>
  
  <p>but when i run it in my php using port 636 or ldaps://servername this is the error,</p>
  
  <pre><code>ldap_bind(): Unable to bind to server: Can't contact LDAP server
  </code></pre>