Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6909217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:39:41+00:00 2026-05-27T08:39:41+00:00

When using ldap_search to get users from Ad server, I get for each entry

  • 0

When using ldap_search to get users from Ad server, I get for each entry several objectClasses.

I’m interested only in the most specific objectClass in the classes hierarchy.
How do I get it?

for example: for the entry

name: user1
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user

I want to get only the “user” objectClass.

I noticed that in the programmatic ldap_search, the most specific class is returned in the last cell of the values array, that is returned from ldap_get_values(ld, entry, "objectClass") function call. Is that by chance or is that a defined behavior?
(in other words, can I rely on this to always be true?)

Thanks for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:39:42+00:00Added an answer on May 27, 2026 at 8:39 am

    For sure you can’t count on heritance order. The solution for you is to specify the objectClass attribute in your ldap search filter, and to cross with objectCategory to eliminate computers for example.

    (&(objectClass=user)(objectCategory=person))
    

    you’ll receive here all the objects of class user and inetOrgPerson (they are also user).

    (&(objectClass=inetOrgPerson)(objectCategory=person))
    

    you’ll receive here all the objects of class inetOrgPerson (but not those which are uniquely user).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i get all the users from the LDAP using PHP. function getUsers()
I am trying to add an entry to an LDAP server using JNDI. I
how can I authenticate from PHP using LDAP when I only have the SamAccountName
I am trying to get all the users and their associated groups from an
I'm using GSSAPI in Java in order to login to an LDAP server using
I am using below code to query changes to users/OUs in AD. But it
I'm having trouble running a complex query against our company LDAP server. I'm using
We are using OpenLDAP client library to conect to an LDAP server. The problem
Scenario We are using Weblogic Server 10.3.4 to run our webapp which has security
I am using Zend_Auth_Adapter_Ldap to authenticate users for my Zend Framework based intranet website.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.