Bulk user add in omero 5.6

Hi @OMETeam

Thanks for restoring the service.
How to add / delete or create bulk user id’s creation in omero 5.6 ? more than 40 user in single file in csv or excel formats to access moero web.

Thanks

It’s great to be back!

There’s no “bulk addition” service, so you’ll need a script, and the question is probably then what scripting language you are most comfortable with.

For example in bash, something like this script:

#!/usr/bin/env bash
# users.sh
OLDIFS=$IFS
IFS=","
while read group username firstname lastname email
 do
    echo "Creating $username ... "
    echo omero user add ${username} ${firstname} ${lastname} ${group} --email ${email}
 done < $1
 IFS=$OLDIFS

can take input like this:

group1,username1,User1,Name1,email1
group2,username2,User2,Name2,email2

to use the OMERO CLI to add users:

./users.sh users.csv
Creating username1 ...
omero user add username1 User1 Name1 group1 --email email1
Creating username2 ...
omero user add username2 User2 Name2 group2 --email email2

(You’ll need to remove the second “echo” in users.sh)

~Josh

Thanks @joshmoore Its worked

1 Like