I have an excel sheet having all the details like user id, emailid ,password ,firstname and lastname. How can import this excel so that it imports are all the users under path /home/users/test.
-
Can you please share some code for your issue ? Are you writing a AEM component to import your users ?– Tien NguyenApr 5, 2015 at 11:34
-
I don't need any component level code . Even a script will do. All I need a script that should import users from excel sheet containing user's details into CQ/AEM– subramanyaApr 21, 2015 at 10:43
2 Answers
Either use Apache POI to write some custom code that reads in the rows of the sheet, and then uses the [JackRabbit UserManager][2] library to create the users.
Alternatively, simply save the Excel as a CSV and write a (bash or bat) script that iterates over the CSV file and calls a POST command to create the user:
curl -u admin:admin -FcreateUser= -FauthorizableId=$UserNameReadFromCSV -Frep:password=$PasswordReadFromCSV http://localhost:4502/libs/granite/security/post/authorizables
-
Thanks for these valuable inputs TIM. Do you have a sample CSV file containing a few sample users so that I can try this at my end. I have never done this before. This requirement is from my client. Apr 21, 2015 at 10:39
May be I am late to the party but I have been working on this requirement and created a utility in the AEM for the same.
This utility allows the users to upload an excel file with the user details and creates users in the AEM to the desired group automatically.
https://aem.redquark.org/2019/05/create-users-in-aem-from-excel-file.html
You can see the code for the same at my GitHub. https://github.com/ani03sha/BulkUserCreation
I hope this helps someone.