Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Mass delete users

Open kadafax opened this issue 9 years ago • 8 comments

Is there a way to mass delete users ? From the UI I can only delete one by one and as I have totally missed my LDAP import, I now have 300+ account to delete... So before I trash the whole mongo db, is there a way to mass delete users or at least is there a way to only dump users db directly in the mongo db ?

kadafax avatar Sep 27 '17 09:09 kadafax

Unfortunately, there is not UI for this yet, but you can delete the users directly on the database on the users collection.

engelgabriel avatar Sep 28 '17 00:09 engelgabriel

Okay, thanks for the quick answer.

For the record, here is a quick how-to for the mongodb noob like me: Stop rocket.chat and enter the mongo shell with "mongo" and then:

use rocketchat db.users.drop()

kadafax avatar Sep 28 '17 08:09 kadafax

Okay, thanks for the quick answer.

For the record, here is a quick how-to for the mongodb noob like me: Stop rocket.chat and enter the mongo shell with "mongo" and then:

use rocketchat db.users.drop()

this command dele all users, including the administrator =/

gabrielranulfo avatar Jun 24 '19 18:06 gabrielranulfo

It is better to remove only LDAP users run the command: db.users.remove({"ldap": true});

rocknr011 avatar Dec 10 '19 12:12 rocknr011

How to remove an individual user?

LDAP integration documentation in Rocket Chat could really use some community support.

dimmthewitted avatar Oct 20 '20 17:10 dimmthewitted

How to remove an individual user?

You can remove an individual user directly from the admin panel. This is the safer way.

rocknr011 avatar Oct 23 '20 03:10 rocknr011

There is no way to just delete the anonymous users?

Mte90 avatar May 19 '21 12:05 Mte90

There is no way to just delete the anonymous users?

use rocketchat;
db.users.deleteMany({"roles": "anonymous"});

bzzworld avatar Jan 08 '22 23:01 bzzworld