Platform SDK: Active Directory, ADSI, and Directory Services

ldap_modrdn2_s

The ldap_modrdn2_s function (or its asynchronous equivalent, ldap_modrdn2) is used to change the name of an LDAP entry.

ULONG ldap_modrdn2_s (
  LDAP* ExternalHandle,
  PCHAR DistinguishedName,
  PCHAR NewDistinguishedName,
  INT DeleteOldRdn
);

Parameters

ExternalHandle
[in] The session handle.
DistinguishedName
[in] The distinguished name to be changed.
NewDistinguishedName
[in] The new relative distinguished name to give the entry.
DeleteOldRdn
[in] TRUE if the old relative distinguished name should be deleted; FALSE if the old relative distinguished name should be retained.

Return Values

If the function succeeds, the return value is LDAP_SUCCESS.

If the function fails, it returns an error code. See Return Values or more information.

Remarks

The ldap_modrdn function allows you to change only the least significant component of the relative distinguished name. Effective with version 3, LDAP provides the Modify Distinguished Name protocol operation that allows access to name-change functions. This functionality is available by calling ldap_rename_ext or ldap_rename_ext_s. We recommend using these functions rather thanf the ldap_modrdn* functions, to change the name of an entry.

Note  When connecting to an LDAP 2 server, the application must perform a bind operation (by calling one of the ldap_bind or ldap_simple_bind routines) before attempting any other operations.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 SP4 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Winldap.h.
  Library: Use Wldap32.lib.
  Unicode: Declared as Unicode and ANSI prototypes.

See Also

Functions, ldap_bind ldap_modrdn2, ldap_rename_ext, ldap_rename_ext_s, ldap_simple_bind, Modifying a Directory Entry