Way to import 100+ new users?

Questions and answers about how to do stuff
Post Reply
cam
Posts: 37
Joined: 26 Oct 2012 17:02

Way to import 100+ new users?

Post by cam »

Is there a way to import new users in EFA from like a CSV file instead of having to manually create 100+ new users?
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Way to import 100+ new users?

Post by shawniverson »

No tool exists for this (yet), but I could create one if you are interested.
cam
Posts: 37
Joined: 26 Oct 2012 17:02

Re: Way to import 100+ new users?

Post by cam »

That would be wonderful Shawn. We need to add around 160 users and would be nice if we could do a csv or something of the sort to import instead of having to manually create each one. How long would something like that take?
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Way to import 100+ new users?

Post by shawniverson »

Shouldn't take very long at all. This weekend?
cam
Posts: 37
Joined: 26 Oct 2012 17:02

Re: Way to import 100+ new users?

Post by cam »

yeah, that would be awesome!
cam
Posts: 37
Joined: 26 Oct 2012 17:02

Re: Way to import 100+ new users?

Post by cam »

Hey Shawn, no rush, but just checking back with you on this. Thanks!
bob.lenz
Posts: 12
Joined: 29 Jun 2015 22:33

Re: Way to import 100+ new users?

Post by bob.lenz »

I was just looking to see if there was such a thing as csv import. Thanks for any tool you can create!
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Way to import 100+ new users?

Post by shawniverson »

Almost ready. Testing it now.
cdburgess75
Posts: 49
Joined: 11 Jun 2014 21:43

Re: Way to import 100+ new users?

Post by cdburgess75 »

Just FYI:

A tool would be awesome. But just wanted to share that I have been able to do this with MS Excel and Webmin. Webmin is a tool that EFA has installed that allows you to dig right to the users mysql table and download the CSV, then edit it and upload. Its very easy to do. A tool would be great, but keep in mind for other areas in mysql that you may want to edit one day (ex:blacklist etc)

/dave
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Way to import 100+ new users?

Post by shawniverson »

Import script is ready :)

Code: Select all

wget https://raw.githubusercontent.com/E-F-A/v3/master/tools/userimport.sh
chmod ugo+x userimport.sh
To use, create your user.csv file as follows:

username,password,fullname,type

where type = U | A | D

U=user
A=admin
D=domain admin

To append new users:

Code: Select all

sudo /path/to/userimport.sh -f user.csv -a
To overwrite users (except admins and domain admins):

Code: Select all

sudo /path/to/userimport.sh -f user.csv -o
Please note that the csv file is not thoroughly validated. Certain characters, such as a ' or other special characters require proper escaping.
Back up prior to using!
webguyz
Posts: 61
Joined: 26 Oct 2016 02:17

Re: Way to import 100+ new users?

Post by webguyz »

Will this work with the current version 3.0.1.5?

This post if over a year old and wondering if password encryption had changed or not.

Thanks!!

Update: I did try it with 3.0.1.5 and it did work, but the password field looks different but I was able to log in, probably because the default uses more then just md5 encryption, but it did work. I have an attachment that shows the pw's from the import (hilited in yellow) compared to the users added thru user manager in Mailwatch.
Attachments
efa-import-pass.PNG
efa-import-pass.PNG (28.7 KiB) Viewed 8395 times
ktan
Posts: 2
Joined: 12 Jan 2017 18:58

Re: Way to import 100+ new users?

Post by ktan »

Is there a way to import users that will be ldap integrated? Have a multi domain EFA configuration using different LDAP servers, but would like to create users without having to have them all log in separately.
Post Reply