无法更新LDAPpipe理员密码
我有以下python脚本来更新LDAP密码。 import ldap from ldap import LDAPError user_dn = "CN=******,OU=Admins,OU=Example Users,DC=Example,DC=com" old_password = "pass01" new_password = "pass02" def change_password(user_dn, old_password, new_password): #ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER) ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT,0) #l = ldap.initialize("ldap://ds.example.com:3268") l = ldap.initialize("ldap://ds.example.com:389") l.set_option(ldap.OPT_REFERRALS,0) l.set_option(ldap.OPT_PROTOCOL_VERSION,3) l.set_option(ldap.OPT_X_TLS,ldap.OPT_X_TLS_DEMAND) l.set_option(ldap.OPT_X_TLS_DEMAND,True) l.set_option(ldap.OPT_DEBUG_LEVEL,255) try: l.simple_bind_s("[email protected]", old_password) except ldap.LDAPError, e: print "LDAP error1: {}".format(e) # Reset Password unicode_pass = unicode('\"' + str(new_password) + '\"', […]