0
我想创建用于更改用户密码的脚本,但不知道现有密码,因此就像将密码重置为新密码一样。在不知道现有密码的情况下修改用户密码
下面是一个使用我的脚本用Python LDAP3
from ldap3 import *
server = Server('myldapserver.com', get_info=ALL)
the_user = 'cn=Manager,dc=domain,dc=com'
conn = Connection(server, the_user, password='adminpass')
conn.bind()
user = 'cn=testuser,ou=People,dc=domain,dc=com'
conn.extend.microsoft.modify_password('cn=testuser,ou=People,dc=domain,dc=com', None, 'newpassword')
print(conn.result)
但它给我的错误:
ldap3.core.exceptions.LDAPAttributeError: invalid attribute type in attribute
如果有人可以帮助我,在此先感谢。