3. Querying Oak LDAP with the ldap* Command-Line Utilities
The instructions in this section assume that you have configured your system according to Common Client Configuration.
$ export KRB5CCNAME=<PATH_TO_CREDENTIALS_CACHE> $ kinit -k -t <PATH_TO_KEYTAB> <PRINCIPAL_NAME> $ ldapsearch -H ldaps://ldap.oak.ox.ac.uk \ -b ou=people,dc=oak,dc=ox,dc=ac,dc=uk \ '(sn=<your surname>)'This should return results including (assuming the principal in question is permitted access to view your record) information about you and other people with your surname.
ldapcompare -H ldaps://ldap.oak.ox.ac.uk \ oakPrimaryPersonID=<yourpersonid (from above)>,ou=people,dc=oak,dc=ox,dc=ac,dc=uk \ eduPersonOrgUnitDN:oakUnitCode=oucs,ou=units,dc=oak,dc=ox,dc=ac,dc=ukThis will return the string "TRUE" or "FALSE" depending on whether you have an affiliation with the unit (in this case oucs).