Questions tagged [ldap3]
164 questions
1
vote
1 answer
Facing Issues with LDAP-Login when using in Python
I am using flask_ldap3_login to login via authentication from Active Directory. Code is provided below for reference.
from flask import Flask, url_for
from flask_ldap3_login import LDAP3LoginManager, AuthenticationResponseStatus
from flask_login…

Tabish Tehseen
- 11
- 3
1
vote
0 answers
python ldap3 set timezone for querys
When i query an Active Directory with ldap3, the timezone for the results seem to be UTC by default.
In the docs i find a timezone module, but i can't figure out how to use it properly, so that my datetime results have an offset of…

fuser60596
- 1,087
- 1
- 12
- 26
1
vote
1 answer
how to decode ldap3 thumbnailPhoto to display it in template?
I'm trying to load a picture from active directory into a django template.
This is the result :
"b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00\x00\x00\x00\x00\x00\xff\xdb\x00C\x00\x02\x01\x01\x01\x01\..."
I have seen the PHP method and tried…

shiko48
- 23
- 3
1
vote
0 answers
How do I resolve "result:19 constraint violation error" for changing manager attribute using ldap3?
I'm trying to change to Microsoft Active Directory user details from Linux using LDAP3 by python.
I could be able to change the user's info such as mobile,department and company,etc successfully but I'm getting an error for just manager…

Raj
- 585
- 4
- 16
- 28
1
vote
1 answer
Unable to Delete Multiple users from LDAP with Ldap3 Python
I am writing a python script that deletes all the users under an OU.
ou=people,cn=AdministrativeLdap,cn=Windchill_11.0,o=ptc.
I am trying to delete the entries by performing the following code but it fails with error " cannot be removed because…

Parthasarathy J
- 17
- 7
1
vote
1 answer
How to add existing entry (user) to an existing group using ldap3 in active directory
I have seen documentation and lot of examples on how to add new entry to a existing group in active directory using LDAP3 but none to add already existing user or entry to another existing group. (to be clear entry already exists in other groups,…

ram
- 31
- 4
1
vote
2 answers
Parse a list to get exact value
I am trying to query Active directory through LDAP to list groups but I get more information than I need. How can I parse the result to only get all group names. For example: LOCAL_java_read and the others and not the rest from the result.
from…
user3580316
1
vote
0 answers
ldap3 query group users returns no user data
I'm using below script to retrieve the members of group using ldap3 in python 3.5 but, it's giving me only the group details and no user data.
script :
conn.search(search_base='CN=Admins,DC=Server,DC=com',…

Chaitanya Lp
- 19
- 1
- 5
1
vote
2 answers
Flask-LDAP3-Login Filter issue - User cannot login
Using flask-ldap3-login to query AD for my web app logins. Works for everyone; but, for users who have "()" in their First name in AD. Here's the Debug log.
UN-SUCCESSFULL LOGIN
DEBUG:root:Validating LDAPLoginForm against…

jerry100
- 11
- 5
1
vote
1 answer
how to modify a generalized time attribute with ldap3
how can I modify a generalized time attribute via modify_replace with ldap3?
if I try:
reset_time = datetime.datetime(1970,1,1, tzinfo=datetime.timezone.utc)
c.modify(dn, {'myGeneralizedTimeAttribute': [(MODIFY_REPLACE, [reset_time])]})
I get the…

ddp
- 122
- 8
1
vote
1 answer
Remain logged in ldap between views using Django
I'm using the ldap3 module and trying to create a simple Web App to search for users in an ldap server. The user (help desk people normally, doing the searching) must log in and input the user searched for.
The code so far creates/binds to the ldap…

pymat
- 1,090
- 1
- 23
- 45
1
vote
0 answers
Cannot run bind() with ldap3 in python3
Below is my code to try and query my ldap server. However, for some reason, I cannot seem to make the bind command work to progress in my code. I continue to get the following message and am not sure what it means or how to fix it. I apologize about…

theonlydante
- 21
- 3
1
vote
1 answer
Python-3.4 Django v-1.9: Ldap issue - module object has no attribute SCOPE_SUBTREE
I have the following configuration for LDAP, if I use ldap.SCOPE_SUBTREE, it shows:
ldap3.SCOPE_SUBTREE, "(uid=%(user)s)")
AttributeError: 'module' object has no attribute 'SCOPE_SUBTREE'
If I use ldap3.SUBTREE - the error that appears:
File…

Sahil Sahay
- 81
- 1
- 9
1
vote
1 answer
How do I add a new user to a group with LDAP in Python?
I'm trying to add a user to Active Directory via LDAP using Python 3 with ldap3.
Currently I have this line of code which works and returns true:
conn.add('cn=' + uid + ',cn=Users,dc=example,dc=com', 'user', {'sAMAccountName': uid,…

Jamie Scott
- 452
- 4
- 20
1
vote
2 answers
Reset Active Directory password using Python and ldap3
I seem to be running into the classic error with resetting passwords in AD even though everything I have found online points generally towards the fact that I should be golden.
Code first.
from ldap3 import *
username = '

IceBawkz
- 41
- 1
- 6