ldifde issue
Hi,
I`m trying to add using ldifde, please see scenario below:
OS: Windows Server 2008
I have created a newuser.ldf file which contains:
cn: CN=April Stewart,OU=Employee,DC=osg,DC=com
changeType: add
CN: April
objectClass: user
sAMAccountName: april,stewart
userPrincipalName: april.stewart@osg.com
givenName: April
sn: Stewart
displayName: Stewart, April
mail: april.stewart@osg.com
description: Sales Representative
title: Sales Representative
department: Sales
Company: MTC
cn: CN=Eric Gako,OU=Employee,DC=osg,DC=com
changeType: add
CN: April
objectClass: user
sAMAccountName: eric,gako
userPrincipalName: eric.gako@osg.com
givenName: Eric
sn: Gako
displayName: Gako, Eric
mail: eric.gako@osg.com
description: Sales Representative
title: Sales Representative
department: Sales
Company: MTC
Then, I run ldifde in command line:
ldifde -i -f newuser.ldf -k
but I`m getting below error:
C:\Users\ADMINI~1\DOCUME~1>ldifde -i -f newuser.ldf -k
Connecting to "w2k8DC1.osg.com"
Logging in as current user using SSPI
Importing directory from file "newuser.ldf"
Loading entries.
Add error on entry starting on line 1: Other
The server side error is: 0x523 The name provided is not a properly formed accou
nt name.
The extended server error is:
00000523: SysErr: DSID-031A11DB, problem 22 (Invalid argument), data 0
0 entries modified successfully.
An error has occurred in the program
No log files were written. In order to generate a log file, please
specify the log file path via the -j option.
PLease Help!
Thanks in advance!!!
July 15th, 2010 6:14am
The server side error is: 0x523 The name provided is not a properly formed account name.
These settings are the cause
sAMAccountName: april,stewart
sAMAccountName: eric,gako
I think you have CN and sAMAccountName values reverse/confused.
sAMAccountName is the Username/logon name....it cannot contain any special characters (except the underscore...i think).
CN is the how the name will be disaplayed in Active Directory Users and Computers.
Display Name is simply a fied inside the User Account Properties. Most poeple set to the same as the CN.
Free Windows Admin Tool Kit Click here and download it now
July 15th, 2010 7:04am
Hi Gunner999,
Thank you very much for your response.
I have made some changes and now I have below error:
C:\Users\ADMINI~1\DOCUME~1>ldifde -i -f newuser.ldf -k
Connecting to "w2k8DC1.osg.com"
Logging in as current user using SSPI
Importing directory from file "newuser.ldf"
Loading entries.
There is a syntax error in the input file
Failed on line 2. The last token starts with 'C'.
0 entries modified successfully.
An error has occurred in the program
No log files were written. In order to generate a log file, please
specify the log file path via the -j option.
regards,
July 15th, 2010 7:54am
To import any object you need 2 fields DN and ObjectClass, plus the required fields for that ObjectClass.
The OU each obect is being placed in MUST exist.
ChangeType:Add is not needed for New records...because its not a change.
You have CN twice, one is the DN, the other is not needed. The CN=...within the DN will be the CN of the object.
Sometimes the best approach is to export a few users with the required fields so you can see what that format is.
Here is what i think you need...untested but should be close.
http://support.microsoft.com/kb/237677
dn: CN=Eric Gako,OU=Employee,DC=osg,DC=com
objectClass: user
sAMAccountName: Eric
userPrincipalName: eric.gako@osg.com
givenName: Eric
sn: Gako
displayName: Gako, Eric
mail: eric.gako@osg.com
description: Sales Representative
title: Sales Representative
department: Sales
Company: MTC
dn: CN=April Stewart,OU=Employee,DC=osg,DC=com
objectClass: user
sAMAccountName: April
userPrincipalName: april.stewart@osg.com
givenName: April
sn: Stewart
displayName: Stewart, April
mail: april.stewart@osg.com
description: Sales Representative
title: Sales Representative
department: Sales
Company: MTC
Free Windows Admin Tool Kit Click here and download it now
July 15th, 2010 5:34pm
Hi Gunner999,
It works!!! thanks a lot!
July 16th, 2010 8:51am