Questions tagged [ldap3]
164 questions
0
votes
1 answer
I'm getting an "invalid filter" error with an LDAP3 search
I'm just starting out with a direct connection from Python using LDAP. I can create the connection properly, but when I try and search:
conn.search('DC=MyCorp,DC=corp', '(objectCategory=inetOrgPerson), samAccountName="jdoakes")')
It returns the…

Simon Templar
- 1
- 2
0
votes
0 answers
why do i suddenly get an import error for ldap3
i was working on the code for a ldap authentification when i get suddenly an import error for ldap3-2.9.1
That is my code:
import os
import socket
import…

Chorum
- 43
- 2
- 11
0
votes
1 answer
Getting all usersinfos from Windows server's Active Directory via LDAP (ldap3 Python)
I would like to fetch every users infos (firstname, lastname, email) from a Windows Server's Active Directory.
So I'm using ldap3 (python) and successed connected to the server (using HyperV Windows Server 2022) with my admin logs:
from ldap3 import…

Jer
- 183
- 3
- 13
0
votes
1 answer
I'm unable to pass the variable value into ldap code to create an account
I'm trying to pass variable to create account in active directory, but i'm not sure how to pass it. It is creating an account in the variable name, not the value of variable.
import ldap3
conn = ldap3.Connection("172.16.251.61",…

gokul kumar
- 11
- 2
0
votes
2 answers
How to do DN resolution using python ldap3 library
I am implementing some login procedure based on an active directory.
The user will type in his mail.
I was already successful finding the users db entry in the AD with the mail - I searched for:
(& (mail={0})(objectClass=organizationalPerson))
and…

EinEsellesEniE
- 129
- 1
- 10
0
votes
0 answers
How to get a user from local AD using ldap3?
I am trying to get a particular user from AD using the ldap3 python module. Here is how I am trying to do it:
from ldap3 import Server, Connection, ALL
srv = Server('company.com', get_info=ALL)
conn = Connection(srv)
if conn.bind():
user =…

a298b112
- 83
- 1
- 8
0
votes
0 answers
import ldap3 error File "", line 1, in File "/usr/local/lib/python3.9/dist-packages/ldap3/__init__.py", line 255, in
I have installed ldap3 module for my python3. When I try to run import ldap3, I get such error. Can someone please advice me what to do?
python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)…

Suspense Sus
- 13
- 5
0
votes
1 answer
I want to modify multiple values at the same time in ldap. How can I do that?
Hi guys I want to modify multiple values at the same. So here I want to modify the users UID Number but I have like 500 users and modifying it one at a time will take a lot of time. So how should I process it? For eg. I have 6 uid numbers…

Robin Malhotra
- 15
- 5
0
votes
1 answer
I want to search the uidNumber from range 7000 to 8000. How can I do that in LDAP3?
I want to search the uidNumber from range 7000 to 8000. How can I do that in LDAP3?
Is it possible to search in range in ldap ?
conn.search('o=csun', '(&(objectclass=person)(uidnumber>=7000))', attributes=['uidNumber'])

Robin Malhotra
- 15
- 5
0
votes
1 answer
Space in OU causing ldap search to fail
I'm using ldap3 library in python3.9 to get all the members and manager details including manager's displayName and Email of specific AD groups into a list with a loop.
conn.search(search_base='OU=Groups,OU=US,DC=local,DC=test,DC=org',
…

Nishanth
- 5
- 2
0
votes
0 answers
I'm trying to get the output in a cvs file. What am I doing wrong?
Here is my script which I wrote for ldap3 and it is working but I want to print the results in a CSV file. What am I doing wrong?
from ldap3 import Server, Connection, ALL
import csv
server = Server('XYZ', get_info=ALL)
conn = Connection(server,…

Robin Malhotra
- 15
- 5
0
votes
1 answer
Flask and Ldap3 not playing nicely together
I'm building an internal app for my company, and are looking into using ldap3 to connect to our exchange server to validate login credentials.
I am integrating into a flask app and have a login view with the following code
@authBP.route('login',…

Henrik Poulsen
- 935
- 2
- 13
- 32
0
votes
2 answers
This script gives all the users data (eg. given output) but I want to fetch specific user's uid, uidnumber, mail, employeenumber. How do I do that?
What I should I do to get users uid number, mail, employeenumber?
from ldap3 import Server, Connection
# clear connection
my_server = 'XXX'
my_user = 'uid=idmsa,ou=People,ou=auth,o=csun'
my_password =…

Robin Malhotra
- 15
- 5
0
votes
0 answers
I am getting this error while searching a user with "uid" with python ldap3 module
I am getting this error while searching a user with "uid" with python ldap3 module
Error:
Traceback (most recent call last):
File "/Users/robinmalhotra/PycharmProjects/pythonProject/main.py", line 6, in
…

Robin Malhotra
- 15
- 5
0
votes
3 answers
Can't get Python ldap3 to show schema
I've got a project to delete the duplicates in a large LDAP database, but so far ...
I am just trying to get the schema and I can't see anything:
>> import ldap3
>>> s = ldap3.Server('ldaps://omitted')
>>> s.schema
>>> s2 =…

Mark McWiggins
- 621
- 6
- 20