Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

How to set email and firstname properties while creating user in RepositoryInitializer script

Avatar

Level 9

I want to create users using RepositoryInitializer. 

 

 

 

create path /home/users/testGroup(rep:AuthorizableFolder)
create user dummy with path /home/users/testUsers with password Test1234

 

 

 

Above command works as expected but I want to add email address and firstname and lastname prop(like below screenshot) in RepositoryInitializer script. Actually these props should be set at profile node like mentioned in below screenshot. I tried with "set properties xx" but it is not working. Any idea how to set prop on user creating command ?

 

Mario248_0-1683296343124.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@Mario248 have you tried like the one below?

 

 

set properties on authorizable(bob), authorizable("Test Group")
  set stringProp to "hello, you again!"
end

 

https://sling.apache.org/documentation/bundles/repository-initialization.html, please see example # test-71.txt in that doc.

 

 

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

@Mario248 have you tried like the one below?

 

 

set properties on authorizable(bob), authorizable("Test Group")
  set stringProp to "hello, you again!"
end

 

https://sling.apache.org/documentation/bundles/repository-initialization.html, please see example # test-71.txt in that doc.

 

 

Avatar

Level 9

No, this is not for users. You provided a scripts for setting up props for group. But I am trying to add prop at user level.

Avatar

Community Advisor

Hi @Mario248 

Below script can be used to create a user at specific path with a password and set properties.

create user userC with path /home/users/xyz with password userGpwd
set properties on authorizable(userC)/profile
    set familyName{String} to familynamefromosgi
end

 

It will create a user named as 'userC' with password 'userGpwd' at path /home/users/xyz.

Second statement will set profile properties in AEM.