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

  • Home
  • SEARCH
  • 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 4038922
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:32:07+00:00 2026-05-20T12:32:07+00:00

I have to write LDAP editor in PHP. LDAP is used for store network

  • 0

I have to write LDAP editor in PHP. LDAP is used for store network devices (switch,AP,..). So, it is not normal functionality and I found lot of problems. The biggest problem is:

Is possible to read all objectClasses from database and all attributes for given objectClass?

Thanks for all replies!!
Ajax

  • 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-20T12:32:07+00:00Added an answer on May 20, 2026 at 12:32 pm

    why not?

    There will be a subschema entry per server which comprises all the objectclasses and attributetypes. (including AD)

    But the subschema entry dn may be different in each implementation, this can be looked up from rootDSE attribute “subschemasubentry”

    -AD example-
    ldapsearch -s base -b "" -D cn=Administrator,cn=users,dc=domain,dc=com -w 'password' -x -h 192.168.3.10 objectClass=* subschemasubentry
    
    **OUTPUT:**
    dn:
    subschemaSubentry: CN=Aggregate,CN=Schema,CN=Configuration,DC=domain,DC=com
    
    
    -OpenLdap example-
    ldapsearch -s base -b "" -D cn=Administrator,dc=capua,dc=com -w password -x -h 192.168.3.11 subschemaSubentry 
    
    **OUTPUT:**
    #
    dn:
    objectClass: top
    objectClass: OpenLDAProotDSE
    subschemaSubentry: cn=Subschema
    

    Also, note the search scope. It should be BASE_LEVEL, otherwise it wont return any result.

    After this search the subschema for objectclasses and attributetypes.

    ldapsearch -s base -b "cn=subschema" -D cn=Administrator,dc=capua,dc=com -w password -x -h 192.168.3.11  objectclass=subschema objectclasses attributetypes
    

    This will return all the objectclasses and attributetypes as string. You dont have an option of querying list of attribute of a given objectclass. You can ONLY get the ldif output of all stored objetclass and attribute. Probably you can write a parser or create some ldif object if that works. But if its AD you might have little flexibility by directly querying cn=Schema,cn=configuration.

    Have a look at the php code. Assuming $ld is connected. Some directory server allows anonymous read on the subschema, in which case you dont need to bind.

      //Get the subschema dn from rootDSE
      $search = ldap_read($ld, "", "objectclass=*", array('*', 'subschemasubentry'));
      $entries = ldap_get_entries($ld, $search);
      $schemadn = $entries[0]["subschemasubentry"][0];
    
      print "Searching ". $schemadn . "<br/>";
    
      // Read all objectclass, attributetype from subschema
      $schsearch = ldap_read($ld, $schemadn, "objectClass=subSchema", array('objectclasses', 'attributetypes'));
      $schentries = ldap_get_entries($ld, $schsearch);
    
      $count = $schentries[0]["attributetypes"]["count"];
    
      print "Printing all attribute types <br/>";
      for ($i=0; $i<$count; $i++)
         print $schentries[0]["attributetypes"][$i] . "<br/>";
    
    
      $count = $schentries[0]["objectclasses"]["count"];
    
      print "Printing all objectclasses <br/>";
      for ($i=0; $i<$count; $i++)
         print $schentries[0]["objectclasses"][$i] . "<br/>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My understanding is that you have to write unit tests that isolate functionality. So
How can I determine if I have write permission on a remote machine in
I have to write an applet that brings up a password dialog. The problem
I have to write something in vbscript that need to use a unique set.
I have to write a component that re-creates SQL Server tables (structure and data)
I have to write a reliable, totally-ordered multicast system from scratch in Python. I
I have to write a program that read from a file that contains the
I have to write a multiplayer pacman game in Java for a university assignment
For a school assignment I have to write x86 assembly code, except I can't
For my programming class I have to write a linked list class. One of

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.