how to delete bulk users with curl command | Community
Skip to main content
April 3, 2017
Solved

how to delete bulk users with curl command

  • April 3, 2017
  • 6 replies
  • 2489 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by vjetty

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-post.html

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! 

6 replies

vjetty
Level 4
April 3, 2017

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

CKG2Author
April 3, 2017

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

vjetty
vjettyAccepted solution
Level 4
April 3, 2017

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-post.html

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! 

vjetty
Level 4
April 3, 2017

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! 

vjetty
Level 4
April 4, 2017

Did it worked for you? 

viperortonrandy
June 28, 2018

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