#include <nwnet.h> or #include <nwdsdsa.h>NWDSCCODE N_API NWDSMoveObject (NWDSContextHandle context, pnstr8 objectName, pnstr8 destParentDN, pnstr8 destRDN);
NWDSMoveObject can move an object only if it is a leaf object (meaning it does not have any subordinate objects associated with it). However, it may be either an object or its alias.
The new RDN (such as ``Hector'') may be the same as the original object's RDN or it may be different.
If you are going to rename the object but not move it, you should call NWDSModifyRDN instead of NWDSMoveObject.
objectName identifies the object whose DN is to be modified. Aliases in the name will not be dereferenced. Aliases are never dereferenced by NWDSMoveObject. The setting of the context flag associated with DCV_DEREF_ALIASES is not relevant to NWDSMoveObject and is ignored.
destParentDN identifies the name of the parent object the moved object is to be directly subordinate to. The parent object must already exist in the Directory tree.
destRDN specifies the new RDN of the object being moved.
If Hector is represented in the Directory tree as
CN=Hector.OU=Graphics.O=WimpleMakers
and you want to move Hector to Marketing, for objectName pass in
CN=Hector.OU=Graphics.O=WimpleMakers
for destParentDN pass in
OU=Marketing.O=WimpleMakers
and for destRDN pass in
CN=Hector
On successful completion, Hector is moved to the new location in the Directory tree, and his complete Directory name becomes
CN=Hector.OU=Marketing.O=WimpleMakers
Directory