Page 1 of 1

Create BULK users in OpenKM

PostPosted:Sat Aug 04, 2018 7:09 am
by saquib.akhtar
How can I create bulk users upto 100 in OpenKM panel ?
Is there any database script for that?

Re: Create BULK users in OpenKM

PostPosted:Sat Aug 04, 2018 3:26 pm
by jllort
If I understood, you are looking for a quick way for creating users ( 100 or more ). With or without roles ?

Re: Create BULK users in OpenKM

PostPosted:Sun Aug 05, 2018 7:46 pm
by saquib.akhtar
yes, creating 100 users with roles

Re: Create BULK users in OpenKM

PostPosted:Mon Aug 06, 2018 5:31 pm
by jllort
In that case I suggest scripting
Code: Select all
import com.openkm.api;

OKMAuth.getInstance().createUser(null, "userId", "password", "test@openkm.com", "User Name", true); // repeat the line for each user
OKMAuth.getInstance().assignRole(null, "userId", "ROLE_TEST"); // repeat the line for each role you wish to assign to the user
You can easily convert excel column as scripting.

Re: Create BULK users in OpenKM

PostPosted:Tue Aug 07, 2018 3:10 am
by saquib.akhtar
Will this need a text file or excel as input ?
(bash scripting)

Re: Create BULK users in OpenKM

PostPosted:Thu Aug 09, 2018 4:37 pm
by jllort
You can write the script manually with copy & paste or as I suggested create an XLS file -> export to CSV -> edit file and remove tabs, etc... -> you get the script ( where each row of the file is the insert )

Re: Create BULK users in OpenKM

PostPosted:Thu Aug 16, 2018 6:20 am
by saquib.akhtar
Thanks !!