# Viewing the Directory Schema

LDAP 3.0 now supports access to a directory's schema information as part of a special entry in the root DN. You can access this information using a ColdFusion query.

| To view the schema for an LDAP directory:

1. Create a new file in Studio.
2. Modify the file so that it appears as follows:

       <HEAD>
           <TITLE>LDAP schema</TITLE>
       </HEAD>

       <BODY>
       <CFLDAP
           NAME="EntryList"
           SERVER="testldap.company.com"
           ACTION="QUERY"
           ATTRIBUTES="dn, subschemasubentry"
           SCOPE="BASE"
           FILTER="objectclass=*"
           START=""
       >

       <CFOUTPUT QUERY="EntryList">
           DN: Root DSE<BR>
           subschemaSubEntry: #subschemasubentry#<BR><BR>
       </CFOUTPUT>

       <P><P><P>
       Use that DN to get the schema attributes...
       <P>

       <CFLDAP NAME="EntryList2"
           SERVER="testldap.company.com"
           ACTION="Query"
           ATTRIBUTES="dn, objectclasses, attributetypes"
           SCOPE="BASE"
           FILTER="objectclass=*"
           START=#EntryList.subschemasubentry#
       >

       <CFOUTPUT QUERY="EntryList2">
           DN=#dn#<BR>
           objectClasses: #objectclasses#<BR><BR><BR>
           attribute Types: #attributetypes#<BR><BR>
       </CFOUTPUT>

       </BODY>
       </HTML>

3. Change the SERVER from testldap.company.com to a valid LDAP server.
4. Save the template as `testldap.cfm` in `myapps` under your Web root directory and view it in your browser.

Note | To be able to the schema for an LDAP server, the server must support LDAP 3.0.