ActiveDirectory autentication with Python

31 Views Asked by At

I am working on small project with creating tons of accounts in AD, using ldap3. So at this moment for establish connection with AD I'm using

try:
    conn = Connection(ad_server, user='domain\\' + username, password=password, auto_bind=True)
    print("Connected!")
    return conn
except Exception as e:
    print("Error:", e)
    return None

Is there a way to gain AD access with logged in Windows user credentials to perform operations on ActiveDirectory, instead of entering login and password to login.

I tried to take user's login data via the Win32 library, but with poor results.

0

There are 0 best solutions below