Options

csvde problems

polesitterpolesitter Member Posts: 6 ■□□□□□□□□□
Hi, when i to do the add users in chapter 3 lesson 2 i always get 0 entries were added successfully the command has completed successfully.

This is what i save to the notepad:

DN,objectClass,samaccountName,sn,givenName,userPrincipalName"CN=Danielle Tiedt,OU=Employees,DC=home,DC=local",user,dtiedt,Tiedt,Danielle,danielle.tiedt@home.local"CN=Lorrin Smith-Bates,OU=Employees,DC=home,DC=local",user,lsmithbates,Smith-Bates,Lorrin,lorrin.smithbates@home.local

All as one continuous line, if i try do it as 3 lines like it says then i get an error message saying error in line 2. There is another post on these forums about this that i have read through and they solved problems like this by removing spaces they had put in but as i have not got any spaces i do not see why i am having this problem.

Any ideas?

Cheers

Chris

Comments

  • Options
    dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    Are you using cvsde with the -i option? Otherwise it will try to export those items, which might be why you're getting an error. You can use multiple lines.
  • Options
    polesitterpolesitter Member Posts: 6 ■□□□□□□□□□
    yes i am saving as USERS.CSV the in the command i type csvde -i -f c:\users.csv

    I just don't get why it is not working
  • Options
    undomielundomiel Member Posts: 2,818
    Check your white space and carriage returns especially at the beginning and end of the file. That is what I find normally breaking this. I remember finding it out helping someone else on this exact same exercise.
    Jumping on the IT blogging band wagon -- http://www.jefferyland.com/
  • Options
    polesitterpolesitter Member Posts: 6 ■□□□□□□□□□
    white space and carriage returns? if i am doing it on one line without spaces as i said surely this won't be an issue

    carriage returns? i am not sure what you mean by that really

    I am sure i am doing it ok and have checked a million times but still can't see what i am doing wrong,

    I am doing it remotely from XP machine would this make a difference?

    Cheers again
  • Options
    dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    Does the employees OU exist? I was getting an error on line 2 until I created it. I also had to change the domain name to what I was using. The rest should be good though.
  • Options
    SieSie Member Posts: 1,195
    dynamik wrote:
    Does the employees OU exist? I was getting an error on line 2 until I created it. I also had to change the domain name to what I was using. The rest should be good though.

    This was my first thought too, check in Active Dirdctory Users and computers for an Employee OU.

    Also check you named your domain home.local

    If either of these are different you will need to change them in the script too.

    EG:

    DN,objectClass,samaccountName,sn,givenName,userPrincipalName"CN=Danielle Tiedt,OU=Employees,DC=home,DC=local",user,dtiedt,Tiedt,Danielle,danielle.tiedt@home.local"CN=Lorrin Smith-Bates,OU=Employees,DC=home,DC=local",user,lsmithbates,Smith-Bates,Lorrin,lorrin.smithbates@home.local
    Foolproof systems don't take into account the ingenuity of fools
  • Options
    polesitterpolesitter Member Posts: 6 ■□□□□□□□□□
    I have created the Employees OU as in the chapter of the book previous. The domain is right as home.local is what i named it.

    If i put it all on one line then i get the message saying the command completed successfully but that no entries were modified which would suggest that it is see the first part ok but is ignoring everything after that so it is not seeing the users etc?

    this is getting quire annoying now

    Cheers
  • Options
    undomielundomiel Member Posts: 2,818
    I think your problem is that you're putting it all on one line and you need to separate them out.

    Here's the script that works for me:

    DN,objectClass,sAMAccountName,sn,givenName,userPrincipalName
    "CN=Danielle Tiedt, OU=Chilton, DC=tileandstoneaccents,DC=local",user,dtiedt,Tiedt,Danielle,danielle.tiedt@tileandstoneaccents.com
    "CN=Lorrin Smith-Bates, OU=Chilton, DC=tileandstoneaccents,DC=local",user,lsmithbates,Smith-Bates,Lorrin,lorrin.smithbates@tileandstoneaccents.com

    Each user to be added is on a separate line.

    If you put it all into one continuous line it doesn't work, I tried it and made sure. Didn't work with all one line, did work after separating out into their own lines.

    You'll get the error message about line 2 if there is ANY extra white space after the header line. Extra white space at the end of the user lines is ok but if you have even one extra white space after the header it will break, so that is where I would look for a culprit, assuming as previously mentioned you have the right DC and right OU.
    Jumping on the IT blogging band wagon -- http://www.jefferyland.com/
  • Options
    polesitterpolesitter Member Posts: 6 ■□□□□□□□□□
    hi thanks for the advice undomiel and others i copied you one and edited it to mine domain etc done on 3 lines so it was like this:

    DN,objectClass,sAMAccountName,sn,givenName,userPrincipalName
    "CN=Danielle Tiedt, OU=Employees, DC=home,DC=local",user,dtiedt,Tiedt,Danielle,danielle.tiedt@home.local
    "CN=Lorrin Smith-Bates, OU=Employees, DC=home,DC=local",user,lsmithbates,Smith-Bates,Lorrin,lorrin.smithbates@home.local

    Then i wrote one myself to see if i could do it but i keep getting "line on error 2 band DN syntax etc"
    still on 3 lines it looks like this:

    DN,objectClass,sAMAccountName,sn,givenName,userPrincipalName
    "CN=Danielle Tiedt, OU=Employees, DC=home,DC=local",user,dtiedt,Tiedt,Danielle,danielle.tiedt@home.local
    "CN=Lorrin Smith-Bates, OU=Employees, DC=home,DC=local",user,lsmithbates,Smith-Bates,Lorrin,lorrin.smithbates@home.local

    Now if anyone can tell me why the top one works and the bottom one doesn't i would love to know what i am doing wrong in typing these things? there is no white space after the first line or anything.

    Cheers again

    Chris
  • Options
    undomielundomiel Member Posts: 2,818
    I copy and pasted your 2nd script listed there and edited it to my domain. Removed the white space at the end of the lines and it ran perfectly. So I would still say that is where your problem is, there is a white space after userPrincipalName.
    Jumping on the IT blogging band wagon -- http://www.jefferyland.com/
  • Options
    dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    Also, you can use the -j option and specify a path (not a filename) for the log file. That might help you figure out where the problem lies more quickly if you have have any problems in the future.
  • Options
    polesitterpolesitter Member Posts: 6 ■□□□□□□□□□
    hi undomiel, when i copy and paste the second one i don't get when you mean by "white space" as the cursor runs to the end of UserPrincipleName and then goes to the next line there is no space at the end, I am really struggling with this everytime i right a command in Notepad i get errors,

    When i get to the end of a line i press return to go to the next line is this where i am going wrong?

    I really need to know as am getting really annoyed as to why none of my scripts work!

    be really simple with explanation

    Cheers again

    Chris
  • Options
    SieSie Member Posts: 1,195
    Have you created the OU Employees or the Container Employees,

    The examples given by polesitter seem fine, seems a daft question but have you checked the spoelling of the domain and OU and checked these in your scripts?

    Im always spelling things wrong icon_lol.gif (left in the mistake in previous paragraph to show what I mean)
    Foolproof systems don't take into account the ingenuity of fools
  • Options
    dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    Polesitter, I create the employees OU, change the domain name to mine, and it works perfectly.

    What you have posted is fine, so you have problems elsewhere. Double-check your domain and OU names. Also use the -j option as I suggested to create a log file, and then post that here.
Sign In or Register to comment.