Pentaho

 View Only

 how can i create automaticly 100 account in the pentaho user console??

  • Pentaho
  • Kettle
  • Pentaho
  • Pentaho Data Integration PDI
Data Conversion's profile image
Data Conversion posted 04-06-2018 15:53

Hello Community,

I have a question for the creation of users on Pentaho User Console,

Actually i want to create 100 account in the Pentaho User Console with an automatic way ( A script or a procedure ). Note that i have the names of those users stored in a database and i need to do it to display the reports and dashboards in the PUC according the user logged.

Thanks


#Pentaho
#PentahoDataIntegrationPDI
#Kettle
Joao Figueiredo's profile image
Joao Figueiredo

Hi,

Don't you have a LDAP or AD to connect to with those users?

Setting Up User Security - Pentaho Documentation

If you still want to use Pentaho user store, then I suggest to use the import-export tool available on the Pentaho Server folder.

Joao Figueiredo's profile image
Joao Figueiredo

You can make a export with this command

./import_export.sh --backup --url=http://localhost:8080/pentaho --username=admin --password=password --file-path=/home/myUser/export.zip --charset=UTF-8 --path=/public --withManifest=true --logfile=/home/myUser/export.log

 

This will generate a zip file with the entire content of your repository, which you want to use now as a kind of knowledge base, or baseline, for what you need to add in order to successfuly import new users since that export file contains the existing users, so you just need to mimic that.

 

Create a manifest file called exportManifest.xml with the below content and place a folder home/joao in a zip file called import.zip in your home folder (eg: /home/myUser/import.zip):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:ExportManifest xmlns:ns2="http://www.pentaho.com/schema/">     <ExportManifestInformation exportDate="12-04-2018 05:20:06 BST" exportBy="admin" rootFolder="/" manifestVersion="2"/>     <ExportManifestEntity path="home/joao">         <ExportManifestProperty>             <EntityMetaData name="joao" createdDate="2018-04-12T12:00:00.000+01:00" isFolder="true" path="home/joao" isHidden="false" isSchedulable="true" locale="en_US" title="Joao"/>         </ExportManifestProperty>         <ExportManifestProperty>             <EntityAcl>                 <aces>                     <permissions>ALL</permissions>                     <recipient>joao</recipient>                     <recipientType>USER</recipientType>                 </aces>                 <entriesInheriting>false</entriesInheriting>                 <owner>joao</owner>                 <ownerType>USER</ownerType>             </EntityAcl>         </ExportManifestProperty>     </ExportManifestEntity>     <ExportManifestUser>         <username>joao</username>         <roles>Authenticated</roles>         <roles>Power User</roles>         <password>password</password>     </ExportManifestUser> </ns2:ExportManifest>

once you run the command below you should get a new user called "joao" in your server along with the user folder

./import-export.sh --restore --url=http://localhost:8080/pentaho --username=admin --password=password --file-path=/home/myUser/import.zip --overwrite=true --logfile=/home/myUser/import.log

 

You can then replicate this for how many users you want, and give them the needed customization by changing the above xml.

Look for further details: here https://help.pentaho.com/Documentation/8.0/Setup/Administration/Repository/Backup_and_Restore_Pentaho_Repositories

Data Conversion's profile image
Data Conversion

Thank you joao for your answer. another thing please i need to create that manually so for all the 100 users?

Joao Figueiredo's profile image
Joao Figueiredo

You can add them all in the same file... I can easily assemble a program to build that for you, or if you want to go all in on Pentaho create a transformation to do it for you

sumit bansal's profile image
sumit bansal

Joao Figueiredo: Do you have any sample transformation which we can used for creating the multiple user in the PUC by using pentaho rest api .

Joao Figueiredo's profile image
Joao Figueiredo

Hi,

I don't have one but use the available steps to read from the DB and then the REST Client step to create the users in the server.

The docs for this two steps are below:

REST Client - Pentaho Documentation

Table Input - Pentaho Documentation

With the REST Client call the create user endpoint. The endpoint docs are below:

Users and Roles for Pentaho Security - Pentaho Documentation

After you are done with this, you can even schedules this in PUC so that users added to the DB are periodically added to Pentaho.

Best regards