Howto generate sambaNTPassword LDAP Attribute

To generate the sambaNTPassword LDAP Attribute you can use the following php snipped.

$password="finger";
echo strtoupper(bin2hex(mhash(MHASH_MD4, iconv("UTF-8","UTF-16LE",$password))));

Returns: 212DB2D2EA55E7973591301C028F7773