LDAP-UX Client Services B.04.15 Administrator's Guide
— Discover search filter, search base or search scope for a particular name service.
— Discover the attribute mapping information for a specified name service.
— Discover the list of available template files for a specific name service when you want
to add a new user or group entry to an LDAP directory server.
— Discover LDAP-UX configuration information about required attributes when creating
a new user or group entry.
— Discover the recommended list of attributes that an interactive management tool can
consider making available for modification for the specified entry.
The following subsequent sections provide examples on how to use ldapuglist, ldapugadd,
ldapugmod, ldapugdel and ldapcfinfo to display, enumerate, add, modify or delete user
accounts and groups in an LDAP directory server.
5.6.2 Listing Users
You can use ldapuglist to list and enumerate POSIX-like account entries in an LDAP directory
server. Below are examples of how to use ldapuglist to list user entries.
While use of LDAP_BINDDN is not typically required to use ldapuglist, the LDAP_BINDDN
and LDAP_BINDCRED environment variables can be used to specify the Distinguished Name
(DN) and password of a user with sufficient directory server privilege to display protected
attributes. Alternately, you can input LDAP administrator bind identity and credential
interactively with a prompt (-P) option.
Setting the LDAP_BINDDN and LDAP_BINDCRED environment variables is optional when using
ldapuglist.
The following commands set the LDAP_BINDDN and LDAP_BINDCRED environment variables:
export LDAP_BINDDN = "cn=Jane Admin,ou=admins,dc=example,dc=com" export LDAP_BINDCRED
= "Jane's password"
The following commands display an account entry for the user, mlee:
cd /opt/ldapux/bin ./ldapuglist
-t passwd -n mlee
The output of the above command is as follows:
dn: cn=Mike Lee,ou=people,dc=example,dc=com
cn: Mike Lee uid: mlee uidNumber: 900 gidNumber: 2010 loginShell:
/usr/bin/sh homeDirectory: /home/mlee gecos: mlee,Building-5,555-555-5555
The following command displays account entries available in the LDAP directory server:
./ldapuglist -t passwd
The output of the above command is as follows:
dn: cn=Mike Lee,ou=people,dc=example,dc=com
cn: Mike Lee uid: mlee uidNumber: 900 gidNumber: 2000 loginShell:
/usr/bin/sh homeDirectory: /home/mlee gecos: mlee,Building-5,555-555-5555
dn: cn=Michael Sheu,ou=people,dc=example,dc=com cn: Michale Sheu
uid: msheu uidNumber: 880 gidNumber: 2010 loginShell: /usr/bin/sh
homeDirectory: /home/msheu gecos: msheu,Building-8,555-555-5000 dn:
cn=Pat Fong,ou=people,dc=example,dc=com cn: Pat Fong uid: pfong uidNumber:750
gidNumber: 2000 loginShell: /usr/bin/sh homeDirectory: /home/pfong
gecos: pfong,Building-10,555-552-5000 ... ...
The following command displays an account entry which contains uid=tscott:
./ldapuglist -t passwd -m -f "(uid=tscott)"
The output is as follows. In this example, the uidNUmber attribute has been mapped to
employeeNumber and the gecos attribute has been mapped to cn, l and telephoneNumber.
With the -m option, the ldapuglist tool displays the mapped attribute names as well.
dn: cn=Tom Scott,ou=people,dc=example,dc=com
cn[cn]: Tom Scott uid[uid]: tscott uidNumber[employeeNumber]: 900
gidNumber[gidNumber]: 2010 loginShell[loginShell]: /usr/bin/sh homeDirectory[homeDirectory]:
114 Administering LDAP-UX Client Services