Questions tagged [ldap3]

164 questions
1
vote
2 answers

adding and removing members to/from active directory group in python

I am trying to write a python-3 based program that could refresh the members of an active directory group in a daily basis or so. The problem is, I have: Security group : cn=groupName, ou=Groups, ou=department, dc=some, dc=company,dc=com User group:…
user1816574
  • 49
  • 1
  • 1
  • 10
1
vote
0 answers

python ldap3 get disabled users

I am trying to get a list of disabled users from active directory. I have working code for pulling AD entries, but I get computers as well as users in the returned results. I also don't know how to filter for disabled accounts if possible. import…
Antikythera
  • 91
  • 1
  • 8
1
vote
1 answer

Django request.method automatically set to GET and not POST

I'd like to setup an LDAP Authentication Backend in Django, and I've already used ldap3 to confirm a bind, with success. I'm now realising that writing a class for my LDAP Backend with just ldap3 is not so straightforward, and that installing …
pymat
  • 1,090
  • 1
  • 23
  • 45
1
vote
0 answers

Spring LDAP template usage for user authentication per request

I have a catch 22. I am implementing a service client whose responsibility is to authenticate a user at an LDAP server. The client accepts a userid and password, determines the userDn, and invoke a request to the LDAP server. My problem is the way…
user2120188
  • 427
  • 1
  • 4
  • 16
1
vote
4 answers

Python 3.5, ldap3 and modify_password()

I've been pulling my hair out trying to send a request to update my own password via a script. here is the code: #!/usr/bin/python3.5 from ldap3 import Server, Connection, NTLM, ALL server = Server('ldap://192.168.0.80', use_ssl=True) conn =…
Comm4nd0
  • 631
  • 8
  • 14
0
votes
0 answers

Python LDAP3 Query to get all users including disabled users

I am trying to query one ldap group using Python ldap3 library. But the result of the search is only giving users who are active. I want to get all the users even the inactive users also. I am not able to find what should I include in the search…
0
votes
1 answer

Python ldap3 how return mail as string (no dict, or list)

I need to get all mail address from ldap for a given cn... The issue is when I try to put: In a list like: mylist = [cn, mail] In a dict like: mydict[cn] = mail But I get something like ['cn', mail: a@a.a] and the result I want is this [cn,…
0
votes
0 answers

ldap3.core.exceptions.LDAPAttributeError: invalid attribute type PasswordExpirationDate

I am trying to fetch data for the field PasswordExpirationDate from Active Directory but getting this error ldap3.core.exceptions.LDAPAttributeError: invalid attribute type PasswordExpirationDate I am using below to connect to…
0
votes
0 answers

python ldap concurrent connections to all domain controllers

I am looking for some suggestions/guidance with python ldap3 running from a lambda function. There is a limit on run-time (15 minutes). I have a python script that pulls all the user's information from the domain, however the lastLogon attribute is…
0
votes
0 answers

How to authenticate with email on ldap3

Is there a way to use email on ldap authentication instead of cn ? I have tried with "cn=test,ou=users,dc=example,dc=org" and it works, but i want to use the email test@example.org. Thank you.
nipuro
  • 310
  • 5
  • 22
0
votes
1 answer

python ldap3 get domain controller list

I need some help with a script, I am trying to get a list of all the domain controllers for a domain. I am using python ldap3 and I am getting errors trying to connect. See below, any suggestions will be appreciated. Code #!/usr/bin/python3 from…
0
votes
0 answers

How to get all Password Policies from Active Directory using python-3.11

I'm using Windows server2019 as an AD-Server and python-3.11 in a domain joined machine to get the password policies of all the users and groups in Active Directory. I've tried multiple ways and codes but none stand out as I'm getting…
0
votes
0 answers

Django - MS Active Directory authentification using django-auth-ldap

I almost broke my mind trying to adjust my test django project to connect with my Active Directory. The goal is to create a simple login page that will check credentials with AD users data. AD located on the same machine as Django. AD users involved…
0
votes
0 answers

Create AD user with python ldap3 not working correctly

Here's my code: ''' def create_ad_user(samaccountname, email, ou, nome='Test'): print(samaccountname, email, ou) server = Server('ldap://', get_info=ALL, use_ssl=True) conn = Connection(server, user='', password='
0
votes
0 answers

Can't add a filter for null in Python 3.x ldap3 search, returns empty set

I want to filter out entries where the EmployeeID field is null or blank. However, I can't figure out why this fails when I add it to the search string. This returns a list of entries (some with a null EmployeeID field, most have the field…