LDAP-UX Client Services B.05.00 Administrator's Guide
— 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.5.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
5.5 Managing users and groups 161