0

I want to get all the available objectclass names and attributes of every objectclass from OpenLDAP (not Active Directory) using c#.

I am able to do this with the ActiveDirectorySchema class when dealing with AD, But i don't know how to do it with other LDAP server.

Can anyone please help?

1 Answers1

0

You need to query the rootDSE and retrieve the value for the "subschemaSubentry" attribute. (cn=schema for openLDAP).

Then query the value from the subschemaSubentry as base and (objectClass=*)

Example shows here.

If you want ONLY objectClasses (which will include the attributes within the objectClasses) use something like:

ldapsearch -h yourLDAPDNS  -b "cn=schema" -s base -D cn=admin,ou=...,dc=yourdomain,dc=com -w secretpassword "(objectclass=*)"  objectClasses
jwilleke
  • 10,467
  • 1
  • 30
  • 51
  • Thanks for the reply, that's exactly what i did and got it working. I enumerated only objectclass and it had all the optional attributes(MAY) and mandatory attributes(MUST) belonging to the class. – Somasundaram Pattabiraman Feb 08 '16 at 07:18