<div dir="ltr"><div>Dear subscribers of the python LDAP mailing list,</div><div><br>I have a qeustion on how to modify a password of a AD user.</div><div>I have been doing it until now this way:</div><div>      </div><div>      name_search = "Test.Test"</div><div>      SEARCH_LOCATION = "OU=Assengraaf,DC=assengraaf,DC=nl"<br></div><div>      user_dn = ("CN=%s," + (SEARCH_LOCATION)) % name_search<br>      server = "ldaps://<a href="http://Server01.assengraaf.nl:636">Server01.assengraaf.nl:636</a>"<br>      ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER)<br>      conn = ldap.initialize(server)<br>      conn.set_option(ldap.OPT_REFERRALS, 0)<br>      conn.set_option(ldap.OPT_PROTOCOL_VERSION, 3)<br>      conn.set_option(ldap.OPT_X_TLS,ldap.OPT_X_TLS_DEMAND)<br>      conn.set_option( ldap.OPT_X_TLS_DEMAND, True )<br>      conn.set_option( ldap.OPT_DEBUG_LEVEL, 4095)<br>      conn.simple_bind_s("<a href="mailto:Administrator@assengraaf.nl">Administrator@assengraaf.nl</a>", "password")<br>      password_value1 = '"{0}\"'.format(password).encode("utf-16-le")<br>      add_pass = [(ldap.MOD_REPLACE, "UnicodePwd", password_value1)]<br>      conn.modify_s(user_dn, add_pass)</div><div><br></div><div>But i want to be able to modify a user password without specifying the location of the user, i just want it to search the entire AD for that user.</div><div>What would be the best way to achieve  this?</div><div><br></div><div>Hope you guys can help me out :)</div><div><br></div><div>Kind regards</div><div><br></div><div>Joey <br></div></div>