Changes the distinguished name of an object or its alias in the eDirectory tree.
#include <nwnet.h> or #include <nwdsdsa.h> N_EXTERN_LIBRARY (NWDSCCODE) NWDSModifyDN ( NWDSContextHandle context, pnstr8 objectName, pnstr8 newDN, nbool8 deleteOldRDN);
uses netwin32 Function NWDSModifyDN (context : NWDSContextHandle; objectName : pnstr8; newDN : pnstr8; deleteOldRDN : nbool8 ) : NWDSCCODE;
(IN) Specifies the NDS context for the request and the name format for the objectName parameter.
(IN) Points to the object’s old name.
(IN) Points to the object’s new name.
(IN) Specifies whether to discard the old RDN. If FALSE, the old RDN is retained as an additional attribute value. If TRUE, the old RDN is deleted.
These are common return values.
0x0000 0000 |
SUCCESSFUL |
0x8996 |
SERVER_OUT_OF_MEMORY |
0x89E2 |
TOO_FEW_FRAGMENTS |
0x89E3 |
TOO_MANY_FRAGMENTS |
0x89E4 |
PROTOCOL_VIOLATION |
0x89E5 |
SIZE_LIMIT_EXCEEDED |
0x89FD |
UNKNOWN_REQUEST |
0x89FD |
INVALID_PACKET_LENGTH |
0x89FE |
BAD_PACKET |
0x89FF |
Failure not related to eDirectory |
nonzero value |
Nonzero values indicate errors. See |
The DN is the name of the object that includes the path from the object to the root container in the eDirectory tree. The object being modified must be a leaf object, but it may be either an object or its alias.
The objectName parameter points to the object whose DN is to be modified. Aliases in the name will not be dereferenced.
The newDN parameter specifies the new DN of the object. For example:
"CN=Mary.OU=Graphics.O=WimpleMakers"
If the container objects in the DN are different from the object's current path, the object is moved to the new container.
If an attribute value in the new DN does not already exist in the object, it is added. If it cannot be added, an error is returned.
If deleteOldRDN is TRUE, all old attribute values in the RDN are deleted. If FALSE, old values remain in the object (but not as a part of the DN). If the naming attribute is single valued, this flag must be TRUE.
If NWDSModifyDN removes the last attribute value of an attribute while identifying a new attribute for the DN, the old attribute is deleted.
Aliases are never dereferenced by NWDSModifyDN. The context flag associated with DCV_DEREF_ALIASES is not relevant to NWDSModifyDN and is ignored.