Python 3.5, ldap3 and modify_password()

后端 未结 4 1178

I\'ve been pulling my hair out trying to send a request to update my own password via a script. here is the code:

#!/usr/bin/python3.5

from ldap3 import Server,         


        
4条回答
  •  抹茶落季
    2021-01-25 18:10

    OK thank you to everyone for your help, and the developers on github.

    the code i used to make this work in the end was...

    from ldap3 import Server, Connection
    
    server = Server('ldaps://', use_ssl=True)
    conn = Connection(server, user="\\", password="", auto_bind=True)
    
    dn = 'CN=,OU=Users,DC='
    
    res = conn.extend.microsoft.modify_password(dn, old_password='', new_password='')
    print(res)
    

    Thought i'd post the working solution as there doesn't seem to be any on the internets!! God speed my fellow devops people.

提交回复
热议问题