LDAP-UX Client Services B.05.00 Administrator's Guide

When the attr=value parameter is used to modify an existing attribute, the ldaphostmgr
command also uses the LDAP replace operation. The replace operation will remove all occurrences
of the specified attribute for an entry and replace it with the value specified. If there are multiple
values for a single attribute in an entry, the use of a single attr=value parameter will replace
all values with the single value specified on the command line. Note that it is possible to specify
more than one occurrence of the same attribute on the command line, if that attribute is
multi-valued, in which case, both values will be created in the entry.
Use of -A or -R changes this behavior (for both the above-listed command arguments and the
attr=value parameters). Any attribute specified as an argument to the -A or -R option will
cause ldaphostmgr to perform an LDAP add operation instead of an LDAP replace operation.
Example: Suppose an entry in an LDAP directory appears as follows:
dn: cn=chef,ou=Hosts,dc=cup,dc=hp,dc=com
cn: chef
ipHostNumber: 0.0.0.0
objectClass: top
objectClass: device
objectClass: iphost
objectClass: domainEntity
owner: uid=domadmin,ou=People,dc=cup,dc=hp,dc=com
entityRole: WebServer
entityRole: DBServer
Performing the following ldaphostmgr command:
ldaphostmgr chef entityRole=NFSServer
Replaces all instances of cn:
dn: cn=chef,ou=Hosts,dc=cup,dc=hp,dc=com
cn: chef
ipHostNumber: 1.2.3.4
objectClass: top
objectClass: device
objectClass: iphost
objectClass: domainEntity
owner: uid=domadmin,ou=People,dc=cup,dc=hp,dc=com
entityRole: NFSServer
As a general rule, be cautious before using ldaphostmgr to change multi-valued attributes.
Also note that ldaphostmgr does not allow use of the same attribute and value pair more than
once, either specified as part of attr=value, -R or -A, or from other command-line options
(for example -i for ipAddress where ipAddress is mapped to some other attribute).
ldaphostmgr will exit with error status before sending any conflicting modification request to
the directory server.
7.3.8.7 Errors and Warnings
Upon exit, ldaphostmgr returns a 0 (zero) exit status if no errors or warnings were encountered.
If ldaphostmgr encounters an error or warning; a nonzero exit status is returned, and one or
more messages are logged to stderr. Messages have the following format:
ERROR: code:
message
or
WARNING: code:
message
Leading extra white space might be inserted to improve readability and follow 80-column screen
formatting. code is a programmatically parsable error key-string, while message is
human-readable. Refer to the LDAP-UX Client Services Administrator's Guide for a list of possible
error codes generated by the LDAP user and group management tools.
276 Command and tool reference