Link to home
Start Free TrialLog in
Avatar of WJoeMoore
WJoeMooreFlag for United States of America

asked on

Use ldf script to change an entity from one OU to another

I manipulate entries in an LDAP (happens to be AD, but I am using standard ldf commands) programmatically.

I need to move a user from one OU to another.  What is the syntax to do that?  For example, I may have a user with the following DN:

CN=Moore\, William J, OU=Students, DC=jacks, DC=local

I need to change him to:

CN=Moore\, William J, OU=Stu_Applicants, DC=jacks, DC=local
Avatar of remmett70
remmett70
Flag of United States of America image

Avatar of WJoeMoore

ASKER

Thanks.  This is the error I now get:

C:\d drive scripts>ldifde -i -f "Test 1235437_3.ldf" -s seacat -j "c:\d drive scripts"
Connecting to "seacat"
Logging in as current user using SSPI
Importing directory from file "Test 1235437_3.ldf"
Loading entries.
Add error on entry starting on line 3: Other
The server side error is: 0x2089 The operation could not be performed because the object's parent is either uninstantiated or deleted.
The extended server error is:
00002089: UpdErr: DSID-031B0CEC, problem 5012 (DIR_ERROR), data 5

From:

#
# ID: 1235437
dn: CN=Moore\, William J,OU=Students,DC=jacks,DC=local
changetype: modrdn
newrdn: CN=Charlie Parker
deleteOldRdn: 1
newSuperior: DC=jacks,DC=local,OU=Stu_Applicants

Stu_Applicants currently has no 'normal' objects--just another OU.  Should we create one manually just to make sure everything is initialized properly?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of alicain
alicain

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You were absolutely correct on the 2nd part of your note.  I switched the DC vs OU order and it worked fine.  Thanks, and I'll give you full credit.
I've requested that this question be closed as follows:

Accepted answer: 0 points for WJoeMoore's comment #a39780775

for the following reason:

Excellent understanding of question and error from first interpretation of answer.
Accidentally gave credit to my own comment.  Too quick on the submit.