Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Migration

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-25-2009, 03:28 PM
Active Member
 
Posts: 32
Default Bulk Provisioning script help

Hi,

I am trying to add multiple users by using the bulk provisioning facility. I create the csv in the form
id,name,passwd
id2,name2,passwd2
...
id99,name99,passwd99<EOF>

When I run the script it tells me their is a number of fields error on the last line (or lines if I have blank lines, too).
If I delete the last line, then the error moves back a line. It barfs in unix and dos format and barfs if I add a final comma before the <EOF>
??
Reply With Quote
  #2 (permalink)  
Old 08-25-2009, 11:14 PM
Zimbra Consultant & Moderator
 
Posts: 20,319
Default

You haven't really given any information that would allow anyone to answer your question. What is the script you're using? What is the format of the input file you're using? There are several threads in the forums that have details of bulk provisioning scripts, have you searched the forums and checked them?
__________________
Regards


Bill
Reply With Quote
  #3 (permalink)  
Old 08-26-2009, 11:23 AM
Active Member
 
Posts: 32
Default Bulk Provisioning

I'm not sure what additional detail will help.

The format of the file is as shown here (I'm using real names in the real file etc.)

name@organisation.org.nz,display name,password<NL>
name2@organisation.org.nz,display name2,password2<NL>
... etc to my last user ...
name11@organisation.org.nz, display name11,password11<EOF>


I have tried recoding from unix to dos with no effect.

Then I'm inputting this file from the Bulk Provision option in the Zimbra Admin Accounts page and after the last full line and any following empty lines are returning an error:-
Linexxarse error:Invalid number of columns.
It is ONLY the last full line and any trailing empty lines that raise the error.

If I introduce a space after the comma (as suggested by the bulk-provision window) then the spaces would seem to be included as part of the data judging by the window display and, in any event, the error recurs.


I had searched the forums but not found any help - of course I may have missed something.

Although I have only 11 users to add, it seems to be an issue that needs resolving.

Is there more I can add, because this information was pretty much in the original post, I thought?

Thanks.
Reply With Quote
  #4 (permalink)  
Old 08-27-2009, 09:00 PM
Elite Member
 
Posts: 338
Default

I think maybe you enter some error lines. Zimbra alway shows which line is error so you should fix them before run script.( maybe you delete them )
Reply With Quote
  #5 (permalink)  
Old 08-28-2009, 12:16 PM
Active Member
 
Posts: 32
Default

Agreed - so if I delete the last line, the previous line (which has become the new last line) shows an error. It must be something to do with the way the last line is terminated. What does Zimbra expect? <EOF>, <NL><EOF>, <NL><CR><EOF>? Tried them all and all give an error, in fact with any combination of <NL> I get two errors - the last alpha line and the single empty final line. There is nothing unusual in the existing last line, no non-alpha characters except the commas. I've rewritten the file and changed it around and all sorts - it is always the last alpha line that has the error.
:-/
Reply With Quote
  #6 (permalink)  
Old 08-28-2009, 09:14 PM
Elite Member
 
Posts: 338
Default

You can use excel to create a file with 3 cols and fill in 3 col. Then you save that file in csv format. Last you can check it by notepad or notepad++, you'll see its format
Reply With Quote
  #7 (permalink)  
Old 08-31-2009, 06:07 AM
Project Contributor
 
Posts: 74
Default

I use this procedure for bulk user creation:

1. Create a csv containing these fields:
email,password,first_name,last_name

2. Use this script to create a zmprov readable output:
Bulk Provisioning - Zimbra :: Wiki

3. Run this script with your csv as argument and direct the output to a file. Then, copy the generated file to, say, /opt/zimbra (for simplicity).

4. su - zimbra and then run zmprov < output_filename

5. Watch the magic happen
Reply With Quote
  #8 (permalink)  
Old 08-31-2009, 02:06 PM
Advanced Member
 
Posts: 191
Default

Quote:
Originally Posted by fviero View Post
I use this procedure for bulk user creation:

1. Create a csv containing these fields:
email,password,first_name,last_name

2. Use this script to create a zmprov readable output:
Bulk Provisioning - Zimbra :: Wiki

3. Run this script with your csv as argument and direct the output to a file. Then, copy the generated file to, say, /opt/zimbra (for simplicity).

4. su - zimbra and then run zmprov < output_filename

5. Watch the magic happen
Which one of the scripts in step 2 should I use if I am to import all ldap users to zimbra? also, the csv that I will be creating where do I have to place that file?

Thanks
Reply With Quote
  #9 (permalink)  
Old 08-31-2009, 02:20 PM
Project Contributor
 
Posts: 74
Default

Quote:
Originally Posted by borngunners View Post
Which one of the scripts in step 2 should I use if I am to import all ldap users to zimbra? also, the csv that I will be creating where do I have to place that file?

Thanks
You use the script that starts like this:

#!/usr/bin/perl

# Lookup the valid COS (Class of Service) ID in the interface or like this
my $cosid = `su - zimbra -c 'zmprov gc Default |grep zimbraId:'`;
$cosid =~ s/zimbraId:\s*|\s*$//g;

The one immediately below the section title "CSV file to zmprov"

You need to dump from your ldap in the format i mentioned above. This dump will be your CSV. Place it wherever you like.

Now, you should have 2 files:
1. The script (let's call it create_zimbra_zmprov.sh)
2. The csv (let's call it userlist.csv)

Then, you'll do:
./create_zimbra_zmprov.sh userlist.csv > zmprov_commands.out

This will generate a file called zmprov_commands.out in the same dir where you run the script.

Copy this file, zmprov_commands.out, to /opt/zimbra
chown it to zimbra:zimbra (chown zimbra:zimbra /opt/zimbra/zmprov_commands.out)

Now, su - zimbra
and now, zmprov < zmprov_commands.out

and let there be light
Reply With Quote
  #10 (permalink)  
Old 08-31-2009, 06:00 PM
Advanced Member
 
Posts: 191
Default

I have an error after following your instructions. I just want the username from my remote ldap instead of the entire email. Below is the error message:
zimbra@test:~$ zmprov < zmprov_commands.out
prov> ERROR: service.INVALID_REQUEST (invalid request: must be valid email addre ss: email@)
prov> ERROR: service.INVALID_REQUEST (invalid request: must be valid email addre ss: email@)
prov> ERROR: service.INVALID_REQUEST (invalid request: must be valid email addre ss: email@)
prov> ERROR: service.INVALID_REQUEST (invalid request: must be valid email addre ss: email@)
prov> ERROR: service.INVALID_REQUEST (invalid request: must be valid email addre ss: email@)
prov> ERROR: service.INVALID_REQUEST (invalid request: must be valid email addre ss: email@)
prov> ERROR: service.INVALID_REQUEST (invalid request: must be valid email addre ss: email@)
prov> prov> zimbra@test:~$


In this case, there was no light :-) it was darknest. Please help

Last edited by borngunners; 08-31-2009 at 06:08 PM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.