cancel
Showing results for 
Search instead for 
Did you mean: 

Get tenant names and users under each tenant

sukumarpant
Champ in-the-making
Champ in-the-making
Hi,

I was wondering if it is possible to get tenant names and the users under them(using a script). I've written a script which returns all the users under the admin login. I have not come across any documentation or API which can allow me to get tenant names by running the script as a super admin.

Is there a way?

Thanks in advance.
2 REPLIES 2

janv
Employee
Employee
As super admin, you can show the list of tenants using the tenant admin console (refer to TenantInterpreter.java). To get a list of all people/usernames you can use the REST interface "/api/people" (refer to People.java and PersonService.java [getAllPeople]).

In a similar way, you could write a Java-backed web script to access the TenantAdminService and PersonService. To get all the users under each tenant would require looping through each tenant and switching context when getting the people (refer to AuthenticationUtil.java [runAs]).

Regards,
Jan

chandu7ee
Champ in-the-making
Champ in-the-making
Hi janv

can u explain in details about it. i am new to alfresco. if possible send any example regarding this issue.

thanks
Chandu