Link to home
Start Free TrialLog in
Avatar of AJThomas
AJThomas

asked on

How do I Export \ Import computers from OU's in Active Directory using CSVDE or LDIFDE?

Hi all,

I am preparing to migrate a charity from Server 2003 SBS to Server 2003 Standard and would ideally like to export and then re-import computers from the OU's in active directory from one server to another.  I can't use the AD Migration tool as SBS does not allow another DC on the same network as it is.

Hope you can help.

Many thanks

James
ASKER CERTIFIED SOLUTION
Avatar of Farhan Kazi
Farhan Kazi
Flag of Australia image

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
Avatar of Brian Pierce
You really should use the transition pack. This will allow you to migrate and keep all your existing Active Directory information and licencing. see http://www.microsoft.com/WindowsServer2003/sbs/techinfo/planning/transition.mspx
Almost same syntax can be following for LDIFDE.
The difference in CSVDE and LDIFDE is that you can use LDIFDE file for object modification and deletion as well while CSVDE is only used for Import (new account) and Export.

Syntax:
LDIFDE -F <File Name Here> -S <Domain Controller Name Here> -R "(objectClass=computer)"

Like:
LDIFDE -F C:\Computers.csv -S SRV01.TRAINING.COM -R "(objectClass=computer)"

For more Info:
http://support.microsoft.com/kb/237677
http://www.computerperformance.co.uk/Logon/CSVDE_LDIFDE.htm

Hope this helps!
Farhan

To specify OU path use -D switch with both CSVDE and LDIFDE

CSVDE [or LDIFDE] -F <File Name Here> -S <Domain Controller Name Here> -D <"OU DN HERE"> -R <"(objectClass=computer)">

Like:

CSVDE -F C:\Computers.csv -S SRV01.TRAINING.COM -D "OU=SALES,DC=TRAINING,DC=COM" -R "(objectClass=computer)"

LDIFDE -F C:\Computers.csv -S SRV01.TRAINING.COM -D "OU=SALES,DC=TRAINING,DC=COM" -R "(objectClass=computer)"
I suggest you read the articles at http://support.microsoft.com/kb/555073.
Avatar of AJThomas
AJThomas

ASKER

Hi farhankazi,

Many thanks for your pointers, they really got me going in the right direction.  What follows is a word of warning to anyone who goes down this route.  

I eventually settles on using CSVDE as I am planning a clean export / import and not modifying any of the attibutes in the process.  However, having completed an export from the one server I then tried to import and have just had the most anoying time (although the pain was worth it in the end).

Every time I tried to import the computer objects the import stopped at line two and gave a message along the lines of
"The server side error is "Multiple values were specified for an attribute
that can have only one value."
0 entries modified successfully.
An error has occurred in the program"

What was very frustrating was that it did not tell me which ones or why.  In my case (and I cannot promise this will be the case for all) it turned out to be the following.
1) When the export had taken place it had created 2 values a) = DN and b) = distinguishedName.  The import didn't like having both as I think they are the same thing (although I am willing to be corrected on this).  
2) I had to remove the following headings, and their data values;
a) codePage
b) countryCode
c) localPolicyFlags
d) primaryGroupID

I am not sure why I had to remove these but any add on comments welcome as it may spare someone else the greif I went through.

Thanks all

James