Questions tagged [ldap-query]

A type of transaction performed against an LDAP database

This is a type of transaction that is performed against an Lightweight Directory Access Protocol (LDAP) database. Usually in the form of a Select, Insert, Update, or Delete.

644 questions
634
votes
4 answers

What are CN, OU, DC in an LDAP search?

I have a search query in LDAP like this. What exactly does this query mean? ("CN=Dev-India,OU=Distribution Groups,DC=gp,DC=gl,DC=google,DC=com");
Ritesh Chandora
  • 8,382
  • 5
  • 21
  • 38
87
votes
4 answers

Query to list all users of a certain group

How can I use a a search filter to display users of a specific group? I've tried the following: (& (objectCategory=user) (memberOf=MyCustomGroup) ) and this: (& (objectCategory=user) …
Madam Zu Zu
  • 6,437
  • 19
  • 83
  • 129
31
votes
5 answers

LDAP query in python

I want to execute the following query in the ldap ldapsearch -h hostname -b dc=ernet,dc=in -x "(&(uid=w2lame)(objectClass=posixAccount))" gidnumber ldapsearch -h hostname -b dc=ernet,dc=in -x "(&(gidNumber=1234)(objectClass=posixGroup))" cn And use…
w2lame
  • 2,774
  • 6
  • 35
  • 48
28
votes
7 answers

Active Directory LDAP Query by sAMAccountName and Domain

How do you do a query of an LDAP store by sAMAccountName and Domain? What is the "domain" property named in Active Directory or LDAP terms? This is what I have for the filter so far. I'd like to be able to add in the…
BuddyJoe
  • 69,735
  • 114
  • 291
  • 466
18
votes
6 answers

How to escape a string in C#, for use in an LDAP query

I have an LDAP query, which I am using to perform a search in C#. It uses two string variables (username and domain) which need to be escaped for security reasons. How should I escape the strings? Is there a function available in C#.NET to do…
Sophia
  • 5,643
  • 9
  • 38
  • 43
16
votes
3 answers

Using DN in Search Filter

In my LDAP Client program sometimes I have to include the DN value within the search filter. But this DN is changing frequently and every I have to change this filter in my code. When I googled it for that I got something like this Suppose you want…
Dungeon Hunter
  • 19,827
  • 13
  • 59
  • 82
16
votes
2 answers

LDAP Search Wildcards in memberOf

We have an LDAP with a number of groups that follow this pattern: Acme-MyApp-ABC-Admin Acme-MyApp-ABC-Bottlewasher Acme-MyApp-ABC-Cook Acme-MyApp-DEF-Admin Acme-MyApp-DEF-Bottlewasher Acme-MyApp-DEF-Cook etc repeated many…
Paul Croarkin
  • 14,496
  • 14
  • 79
  • 118
14
votes
2 answers

LDAP/AD filter - "objectclass not equal to" is not working

I am working with LDAP Active Directory and trying to list all users. I have this filter which works perfect: (&(objectclass=user)(|(memberOf=...)(memberOf=...)...)(|(userprincipalname=...)(displayname=...))) Unfortunately, we have also a computer…
shadyyx
  • 15,825
  • 6
  • 60
  • 95
13
votes
2 answers

case insensitive LDAP searches

What is the syntax for performing a case-insensitive match on a uid attribute? If attribute definition matters then how would that be changed? In particular I am using ApacheDS for my LDAP store.
harschware
  • 13,006
  • 17
  • 55
  • 87
12
votes
3 answers

ldap filter for distinguishedName

I am successfully querying our Active Directory for a user with the following code: $filter = (&(objectCategory=person)(samaccountname=someusername)); $fields =…
dnagirl
  • 20,196
  • 13
  • 80
  • 123
10
votes
1 answer

Recursively query LDAP roles from multiple OUs for a User

I am running a Web Application on a WildFly 9.0.2 Server with a Custom Login Realm (which needs to recursively query multiple Organizational Units A for Organizational Units B that are queried from Organizational Units C for a user) that is…
Setup
  • 330
  • 2
  • 21
10
votes
5 answers

How do I run a ldap query using R?

I want to make a query against a LDAP directory of how employees are distributed in departments and groups... Something like: "Give me the department name of all the members of a group" and then use R to make a frequency analysis, but I can not…
Luxspes
  • 6,268
  • 2
  • 28
  • 31
9
votes
2 answers

ldap query: ldapsearch for uniqueMember

How can I search for a uniqueMember in an objectClass groupOfUniqueNames within OpenLdap? dn: cn=group,dc=example,dc=com objectclass: groupOfUniqueNames cn: group uniquemember: uid=member1 uniquemember: uid=member2 I've tried the following with no…
Christoph
  • 1,113
  • 5
  • 17
  • 35
8
votes
1 answer

memberOf vs. groupMembership in LDAP (Liferay)

What is the difference b/n memberOf attribute and groupMembership attribute when used in LDAP Authentication settings in Liferay? The users are imported successfully. The groups are also imported successfully. But the users are not assigned to the…
Ashok Goli
  • 5,043
  • 8
  • 38
  • 68
8
votes
2 answers

How to remove all records from LDAP?

Is it possible to remove all entries from LDAP by one-line commend? I tried: ldapdelete -r 'cn=*,dc=domain,dc=com' -w but it's not working. I have no better ideas;/
ruan
  • 179
  • 1
  • 2
  • 8
1
2 3
42 43