WebLdapRename Function

Action

Renames an existing LDAP directory entry. This function allows only renaming leaf entries, not interior nodes of an LDAP directory.

Include file

WebAPI.bdh

Syntax

WebLdapRename( in hLdap      : number, 
               in sOldName   : string, 
               in sNewName   : string, 
               in sNewParent : string allownull, 
               in bDelete    : boolean ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hLdap Handle to a Web connection that was created by WebLdapConnect
sOldName Name of the directory entry to be renamed. This entry must be a leaf in the LDAP directory tree
sNewName New relative distinguished name (RDN) to assign to the entry
sNewParent Specifies the distinguished name of the new parent entry. Pass NULL to the function if you do not want to move the entry to a different location in the directory tree
bDelete Specifies whether the attribute values in the old relative distinguished name should be removed from the entry or retained as non-distinguished values

Example

dcltrans 
  transaction TMain 
  var
    hLdap: number; 
  begin
    WebLdapConnect(hLdap, "standardhost", WEB_PORT_LDAP);
    WebLdapBind(hLdap, "cn=adminname", "password"); 
    WebLdapRename(hLdap, "cn=oldCN,o=Name", "cn=newCN ", NULL, false);
    WebLdapDisconnect(hLdap); 
  end TMain;

SilkEssential sample

LDAP.sep