Update Active Directory Password using ldap python

前端 未结 3 1739
你的背包
你的背包 2020-12-22 06:33

Basically trying to reset the user\'s password using LDAP python. I\'ve gone through various posts here but no luck :(.

Tried using :

  • a) mo

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-22 07:29

    From what I can see is that you user_dn is not correctly set. Double check and ensure you full DN actually exists in the Directory Server. Check your username variable is correctly parsed (No newline or tab characters) and the Base DN is verified.

    sys.stderr.write('Error setting AD password for: ' + username + '\n')
    sys.stderr.write('DN: ' + user_dn + '\n')
    sys.stderr.write('Message: ' + str(e) + '\n')
    

    The error message is pretty clear that AD cannot find the object (DN) it wishes to modify **(NO_OBJECT)

    {'info': "0000208D: NameErr: DSID-0310020A, problem 2001 (NO_OBJECT), 
    data 0, best match of:\n\t'DC=mydomain,DC=com'\n", 'matched': 
    'DC=mydomain,DC=com', 'desc': 'No such object'}
    

提交回复
热议问题