07-12-2021 09:29 AM
I am in the process of migrating an ACS 4.2.6 instance to a new data center and have the tedious task of creating locally authenticated users in place of the LDAP-authenticated users on the source system. Part of this process will entail adding users to the appropriate groups. Is there a way to print out a list of users and the groups to which they belong? I found these 2 API calls to generate a list of users and groups:
curl -u admin:****** "http://localhost:8080/alfresco/s/api/people" > users_20210708.json curl -u admin:****** "http://localhost:8080/alfresco/s/api/groups" > groups_20210708.json
...but the list of users didn't include their group membership, nor did the list of groups include which users were a part of them. I know I can get this information from the admin console, but I was hoping for an easier way,
Thank you in advance!
07-12-2021 10:24 AM
From what i could recall, there are no apis OOTB as of ACS5.2.x, not sure about upcoming versions though. However,
Try these apis in combination :
http://127.0.0.1:8080/alfresco/s/api/people --> Gives the list of users
Iterate the list of users and call the below api for each user -->
http://127.0.0.1:8080/alfresco/service/api/people/{userId}?groups=true
Example:
http://127.0.0.1:8080/alfresco/service/api/people/admin?groups=true
This should give you user's associated groups.
Alternatively you can also try this script: https://github.com/abhinavmishra14/alfresco-scripts/blob/master/src/main/java/com/github/abhinavmish...
It will give you a user report with their groups and associated sites as well. A sample report can be seen here: https://github.com/abhinavmishra14/alfresco-scripts/blob/master/samples/userReports.json
Explore our Alfresco products with the links below. Use labels to filter content by product module.