0

I'm on the very last section of my password changer, and for some reason it just won't change the password. It's connecting to the AD server fine (checked event logs), there are no errors when trying it, but for some reason the password won't actually change.

Here's the connection code:

server= Server("DCNAME", port = 636, use_ssl = True)
connection= Connection(server, user='DOMAIN\\USER', password='PASSWORD', authentication=NTLM , auto_bind=True)

And here's the password changing code:

dn = "cn = {0}, ou= Users, dc=DC, dc=local".format(user_name.get())
connection.extend.microsoft.modify_password(dn, new_password=user_password.get())

All together should work like this:

User inputs email --> Sent otp --> Put in username (stored in user_name entry in tkinter) --> Enter password sent to their email (stored in user_password entry in tkinter) --> change password

Does anyone know why it won't change the password in AD?

Thanks in advance!

EDIT: Just added the ssl encryption when connecting to the server, but still not changing password

EDIT2: Made it print the connection results and get this back:

{'result': 32, 'description': 'noSuchObject', 'dn': 'OU=Users,DC=DC,DC=local', 'message': "0000208D: NameErr: DSID-0310020A, problem 2001 (NO_OBJECT), data 0, best match of:\n\t'OU=Users,DC=DC,DC=local'\n\x00", 'referrals': None, 'type': 'modifyResponse'}

Am I right in saying it's completely ignoring the CN?

1 Answers1

0

Have you tried without the blanks after the equal signs in the dn? .

cannatag
  • 1,528
  • 11
  • 17