set password for new LDAP user
<p>I've been trying to create windows user accounts out of PHP which itself is no problem. The only thing I can't do is to set the windows user password to the company standard password. 
I can create, change and delete the user account without any problems except for the password. Every time I create a user and try to log myself in with the credentials all I get is a "username or password wrong". And I checked the username. </p>

<p>What I tried so far:</p>

<ul>
<li><code>ldapp_add</code> with clear password (<code>$ldaprecord['userPassword'] = "standard";</code>)</li>
<li><code>$ldaprecord['userPassword'] = '{MD5}' . base64_encode(pack('H*',md5($newuser_plaintext_password)));</code> like in the given example at <a href="http://php.net/manual/de/function.ldap-add.php" rel="nofollow noreferrer">php.net</a></li>
<li>tried to change password after adding the user see <a href="https://stackoverflow.com/questions/5719082/change-password-in-active-directory-using-ldap-php-iis-ssl">this</a></li>
</ul>

<p>It seems that I can change <code>$ldaprecord['userPassword']</code> but when I try to change <code>ldaprecord['unicodePwd']</code> the server is unwilling to do my request.
Which is the right one for the password?</p>

<p>I am not connecting to the AD via SSL. Is this my mistake? If so why can I delete user but not set their password?</p>

<p>Thanks in advance.</p>

<p><strong>EDIT:</strong></p>

<p>Asked the sysadmin to establish a connection via SSL but he said the Lightweight Directory Services weren't even installed on the DC. In his opinion I'm working directly on the AD. Any thoughts on that?</p>

<p>Working on Windows 2012 R2 with IIS.</p>