Solved

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

Posted on 2014-01-14
6
391 Views
Last Modified: 2014-01-14
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
0
Comment
Question by:WJoeMoore
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 

Author Comment

by:WJoeMoore
ID: 39780739
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!
0
 
LVL 5

Accepted Solution

by:
alicain earned 500 total points
ID: 39780767
Hello WJoeMoore,

The new parent OU will need to exist already, you could create an object as a test, but no real need to.  If its a heavily distributed environment then ensuring that replication has occurred everywhere would be wise, but more likely the problem is that the DN is the wrong way around there, it should be:
   OU=Stu_Applicants,DC=jacks,DC=local

Regards,
Alastair.
0
Supports up to 4K resolution!

The VS192 2-Port 4K DisplayPort Splitter is perfect for anyone who needs to send one source of DisplayPort high definition video to two or four DisplayPort displays. The VS192 can split and also expand DisplayPort audio/video signal on two or four DisplayPort monitors.

 

Author Comment

by:WJoeMoore
ID: 39780775
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.
0
 

Author Comment

by:WJoeMoore
ID: 39780780
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.
0
 

Author Closing Comment

by:WJoeMoore
ID: 39780781
Accidentally gave credit to my own comment.  Too quick on the submit.
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
A hard and fast method for reducing Active Directory Administrators members.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question