cancel
Showing results for 
Search instead for 
Did you mean: 

createPerson API

kung
Champ in-the-making
Champ in-the-making
Hello,
I realized that createPerson() API also creates a folder in User Homes space, which i don't want.
Is there any way to change the default space location for newly created user or is there a way to "turn off" automatic space creation upon user creation?

my code:

var newUserName = "kungfuce";
var newUserPassword = "kungfuce";
var newUser = people.createPerson(newUserName,"kung", "Fu Ce","kung@smain.com", newUserPassword ,true);
newUser.save();

now i didn't state anywhere to make folder, but it is made, in User homes named "kungfuce".

i could do :
var userhome = companyhome.childByNamePath("User Homes");
var myfolder = userhome.childByNamePath(newUserName);

newUser.properties["cm:homeFolder"] = myfolder;

but that would create two folders (yes, i know i can delete old one) but script is meant to handle A LOT of data, so those extra useless lines will slow it down.

What i want to know is if there's a way to skip that extra work and do it when creating person

Thanks in advance!
2 REPLIES 2

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
Can you move the created user space?

kung
Champ in-the-making
Champ in-the-making
We could probably move created user space, but is there any better way?
Can user space be created in any other space?