Natxo Asenjo wrote:


On Thu, Mar 24, 2016 at 8:14 PM, Armstrong, Jeffrey
< <>> wrote:


    __ __

    I would like to find out if I can create a large number of users in
    IPA at one time.  If so, what is the command to do that.____

you can use ipa user-add command in a bash loop, or read the user names
from a file, feeding that file to ipa user-add.

There is also a batch command which is used by the UI to send multiple commands at once. This saves on some roundtrip time.

Here is some semi-python, grossly simplified

batch = []
for line in 'output_from_etc_passwd':
    (login, passwd, uid, gid, gecos, dir, shell) = line.split(':')
                      params=([login], dict(gidnumber=int(gid),
gecos=gecos.strip(), homedir=dir, shell=shell, givenname=first, sn=last, noprivate=u'true', addattr='userPassword={crypt}%s' % passwd))))

results = api.Command['batch'](batch)['results']

You probably don't want too many requests at once, say 50 or 100 might be nice.

The results will be a list of all the outputs from the various commands.


Manage your subscription for the Freeipa-users mailing list:
Go to for more info on the project

Reply via email to