-
In a text editor, create an LDIF file with the new attribute definition.
In this example, the LDIF file is named myschema.ldif.
dn: cn=schema changetype: modify add: attributeTypes attributeTypes: ( contractorStatus-OID NAME 'contractorStatus' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE USAGE userApplications X-ALLOWED-VALUES ( ’Y’ ’N’ ’y’ ’n’ ) X-ORIGIN 'PingDirectory Server Example' )
-
To add the attribute, run ldapmodify.
$ bin/ldapmodify --filename myschema.ldif
-
To verify the addition, display the attribute using
ldapsearch.
$ bin/ldapsearch --baseDN cn=schema --searchScope base \ --dontwrap "(objectclass=*)" attributeTypes | grep 'contractorStatus'
-
To view the custom schema file, go to
<server-root>/config/schema/99-user.ldif.
For this example, you see the following details:
dn: cn=schema objectClass: top objectClass: ldapSubentry objectClass: subschema cn: schema attributeTypes: ( contractorStatus-OID NAME 'contractorStatus' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE USAGE userApplications X-ORIGIN 'PingDirectory Server Example' )