Skip to content

Latest commit

 

History

History
130 lines (87 loc) · 5.25 KB

nf-winldap-ldap_modrdn2.md

File metadata and controls

130 lines (87 loc) · 5.25 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:winldap.ldap_modrdn2
ldap_modrdn2 function (winldap.h)
The ldap_modrdn2 function (winldap.h) changes the relative distinguished name of an LDAP entry.
_ldap_ldap_modrdn2
ldap.ldap__modrdn2
ldap.ldap_modrdn2
ldap_modrdn2
ldap_modrdn2 function [LDAP]
ldap_modrdn2A
ldap_modrdn2W
winldap/ldap_modrdn2
winldap/ldap_modrdn2A
winldap/ldap_modrdn2W
ldap\ldap_modrdn2.htm
ldap
7bf7370f-a5e6-474e-8fe9-e6895ef48ab5
08/03/2022
_ldap_ldap_modrdn2, ldap.ldap__modrdn2, ldap.ldap_modrdn2, ldap_modrdn2, ldap_modrdn2 function [LDAP], ldap_modrdn2A, ldap_modrdn2W, winldap/ldap_modrdn2, winldap/ldap_modrdn2A, winldap/ldap_modrdn2W
winldap.h
Windows
Windows Vista
Windows Server 2008
ldap_modrdn2W (Unicode) and ldap_modrdn2A (ANSI)
Wldap32.lib
Wldap32.dll
Windows
19H1
ldap_modrdn2
winldap/ldap_modrdn2
c++
APIRef
kbSyntax
DllExport
Wldap32.dll
ldap_modrdn2
ldap_modrdn2A
ldap_modrdn2W

ldap_modrdn2 function

-description

The ldap_modrdn2 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.

-parameters

-param ExternalHandle [in]

The session handle.

-param DistinguishedName [in]

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

-param NewDistinguishedName [in]

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

-param DeleteOldRdn [in]

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

-returns

If the function succeeds, it returns the message ID of the modify operation.

If the function fails, it returns –1 and sets the session error parameters in the LDAP data structure.

-remarks

Use the ldap_modrdn2 function, or its synchronous equivalent, ldap_modrdn2_s, to change the name of an LDAP entry.

As an asynchronous function, ldap_modrdn2 returns a message ID for the operation. Call ldap_result with the message ID to get the result of the operation. To cancel an asynchronous add operation before it has completed, call ldap_abandon.

Be aware that the various ldap_modrdn functions enable 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, which enables more general name-change access. This functionality is available by calling ldap_rename_ext or ldap_rename_ext_s. These functions are recommended, instead of the ldap_modrdn2 function, to change an entry name.

Multithreading: Calls to ldap_modrdn2 are thread-safe, provided that LdapGetLastError is used to retrieve the actual session error code when the function call returns the -1 failure code.

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 other operations.
 

-see-also

Functions

Modifying a Directory Entry

ldap_abandon

ldap_modrdn2_s

ldap_rename_ext

ldap_rename_ext_s

ldap_result