ldap_modrdn2_s function (winldap.h)

The ldap_modrdn2_s function changes the relative distinguished name of an LDAP entry.

This function is obsolete. For LDAP 3 or later, use the ldap_rename_ext or ldap_rename_ext_s functions.

Syntax

WINLDAPAPI ULONG LDAPAPI ldap_modrdn2_s(
  [in] LDAP       *ExternalHandle,
  [in] const PSTR DistinguishedName,
  [in] const PSTR NewDistinguishedName,
  [in] INT        DeleteOldRdn
);

Parameters

[in] ExternalHandle

The session handle.

[in] DistinguishedName

A pointer to a null-terminated string that contains the distinguished name to change.

[in] NewDistinguishedName

A pointer to a null-terminated string that contains the new relative distinguished name to give the entry.

[in] DeleteOldRdn

TRUE if the old relative distinguished name should be deleted; FALSE if the old relative distinguished name should be retained.

Return value

If the function succeeds, the return value is LDAP_SUCCESS.

If the function fails, it returns an error code. For more information, see Return Values.

Remarks

Be aware that the various ldap_modrdn functions allow you to change only the relative distinguished name, which is the least significant component of the object's distinguished name. Effective with version 3, LDAP provides the Modify Distinguished Name protocol operation that allows access to name-change functions. This feature is available by calling ldap_rename_ext or ldap_rename_ext_s. These functions are recommended, rather than the ldap_modrdn2_s function, to change an entry name.

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

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header winldap.h
Library Wldap32.lib
DLL Wldap32.dll

See also

Functions

Modifying a Directory Entry

ldap_bind

ldap_modrdn2

ldap_rename_ext

ldap_rename_ext_s

ldap_simple_bind