active-directory

ldap3 python search members of a group and retrieve their sAMAcountName (NT Username)

ldap3 python search members of a group and retrieve their sAMAcountName (NT Username) Question: I retrieve members of a group and their sAMAccountName (NT Accounts) I run the following code takes from: ldap3 python search members of a group and retrieve their sAMAcountName (Active Directory) I’m getting user name as output but after few I’m …

Total answers: 1

ldap3 extend.microsoft.modify_password keeps returning false

ldap3 extend.microsoft.modify_password keeps returning false Question: I’m trying to modify an user account password in but it doesn’t work, I’ve tried it directly in AD and it does work. I’m using ldap3 to do it, here’s the steps I do. First I do the app operation like this from ldap3 import Server, Connection, ALL s …

Total answers: 2

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?

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? Question: 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 = …

Total answers: 2

django-auth-ldap: LDAPS causes the first login attempt to fail

django-auth-ldap: LDAPS causes the first login attempt to fail Question: I have configured django-auth-ldap with with the ldap protocol (unencrypted) to authenticate against an Active Directory instance, and it works. The problem is when I attempt to connect via ldaps, then the first authentication attempt always fails, but the second one succeeds. The error message …

Total answers: 1

LDAP Filter Syntax

LDAP Filter Syntax Question: I am using python library ldap3 to send requests to the servers to query user objects that are not disabled and have a display name or email that contains the user input: query = "(&(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(|(displayName={0}*)(mail={0}*))".format(value) I followed what I think the documentation says about forming LDAP filters, but I am getting …

Total answers: 2

import data from csv and create list of Active Directory users

import data from csv and create list of Active Directory users Question: hey so i am trying to make the same script from powershell in python but i cant get it right maybe you can help me out, so the script is like that: opens a csv file with the users information create users for …

Total answers: 3

LDAP search with username as variable

LDAP search with username as variable Question: I am using the Python-LDAP module and trying to make a query on the logged in user. The username will be passed into the query. When I simply type the username in as a string my results come out correctly. But if I try to pass the (username) …

Total answers: 4

How should I escape ldap special characters?

How should I escape ldap special characters? Question: I’m using python-ldap to query Active Directory I have this DN CN=Whalen, Sean,OU=Users,OU=Users and Groups,DC=example,DC=net That works fine as a base in a query, but if I try to use it in a search filter like this (&(objectClass=group)(memberof:1.2.840.113556.1.4.1941:=CN=Whalen, Sean,OU=Users,OU=Users and Groups,DC=example,DC=net)) I get a Bad search filter …

Total answers: 2

How to set folder permissions in Windows?

How to set folder permissions in Windows? Question: I’m using Python to create a new personal folder when a users AD account is created. The folder is being created but the permissions are not correct. Can Python add the user to the newly created folder and change their permissions? I’m not sure where to begin …

Total answers: 8

Using AD as authentication for Django

Using AD as authentication for Django Question: I’m working on a Django-based application in a corporate environment and would like to use the existing Active Directory system for authentication of users (so they don’t get yet another login/password combo). I would also like to continue to use Django’s user authorization / permission system to manage …

Total answers: 5