Expand my Community achievements bar.

SOLVED

how to delete bulk users with curl command

Avatar

Level 1

Hi Team,

I have a bulk users list which need to delete from Author instance (CQ 5.6.1) with curl command. 

Could you please guide/suggest?

Br
Chandrakant Gurhale

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi, Chandrakant

You can use the following parameter in your curl command for multiple items ":applyTo" - 

-F":applyTo=/content/page1" -F":applyTo=/content/page2"

For more info on this please refer - https://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-po...

I hope all 10 author instances are in sync when it comes to users and how they've been created. Please check that before you proceed. 

Thanks! 

View solution in original post

6 Replies

Avatar

Level 4

Hi, Chandrakanth

Please put up more details around the requirement. You want to delete the users from author? How many users you are expecting to delete and what details you have in your bulk users list. Did you sort out what users need to be deleted from AEM? To delete users in bulk you need to be careful enough. 

Thanks,

Vamsi

Avatar

Level 1

Hi Vamsi, 
Thanks for your reply.  Please find my below comments

1] Yes this is on Author.
2] More than 70 users.
3] User login ID.
4] Yes, these all are Authoring users.

We need to run this removal task (with Curl) on 10 individual Author instances and all Author instances had different user login id's which are unwanted.

Appreciate your suggestions in Advance.

Br
Chandrakant Gurhale

Avatar

Correct answer by
Level 4

Hi, Chandrakant

You can use the following parameter in your curl command for multiple items ":applyTo" - 

-F":applyTo=/content/page1" -F":applyTo=/content/page2"

For more info on this please refer - https://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-po...

I hope all 10 author instances are in sync when it comes to users and how they've been created. Please check that before you proceed. 

Thanks! 

Avatar

Level 4

And, if you don't have details listed foe user, here is the utility I created little while ago and it will help you to get users details quickly into report along with groups. Please try in your local first. It is compiled against AEM 6.1 SP2. 

https://github.com/vamsijetty/useradmin-utility.git

Hope it helps! Thanks! 

Avatar

Level 1

Hi I tried the tool but I am getting an error,

28.06.2018 15:11:43.708 *ERROR* [0:0:0:0:0:0:0:1 [1530178903706] GET /bin/tools/listSelectedGroupsUsers HTTP/1.1] com.handsonaem.vamsijetty.useradminutility.core.servlets.ListSelectedGroupsUsers java.lang.NullPointerException