#1 2017-07-11 17:48:57

shivam.panchal
Member
Registered: 2017-07-06

Import/Create multiple users under different organisational unit

Hii, We are using community edition of RS and I have setup some dashboards, now, i want to create multiple users like 200 so that they can access the created dashboards. My question is that, is there any way to generate multiple users provided user-id and password which could be same, that they can change later. So, please let me know, if  i can do this without creating those individually.

Thanks in Advance.

Offline

#2 2017-07-12 07:59:46

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Import/Create multiple users under different organisational unit

Hi shivam,

for this, you would need scripting (only available in ee). Here is an example script which creates a user "sampleUser" with password "abcdef", adding the user to the "exampleOU" organizational unit.
If you want to stay with the community edition, you could execute your script during the trial period.

Another possibility would be, as you pointed out here: https://forum.reportserver.net/viewtopic.php?id=903, to simulate an export with XML and then import the data.

import net.datenwerke.security.service.usermanager.UserManagerService;
import net.datenwerke.security.service.usermanager.entities.User;
import net.datenwerke.security.service.usermanager.entities.OrganisationalUnit;

UserManagerService userManagerService = GLOBALS.getRsService(UserManagerService.class);


/* create user */
User user = new User();
user.setUsername("sampleUser");
user.setFirstname("Sample");
user.setLastname("Test");
		
		
List<OrganisationalUnit> ouList = userManagerService.getOUsByName("ExampleOU");
for (OrganisationalUnit ou: ouList) {
	ou.addChild(user);
}
userManagerService.persist(user);
userManagerService.merge(user);
		
userManagerService.setPassword(user, "abcdef");

"User created";

Best regards,
Eduardo

Offline

Board footer

Powered by FluxBB