How to delete users from de DB

Description

Hi, I’ve imported all the users from my Active Directory domain, with it came thousands of users that will not be used. I need to delete un bulk these users but I don’t know where in the database are they.
I’m using robomongo for it.

Thank you

Server Setup Information

  • Version of Rocket.Chat Server:
  • Operating System:
  • Deployment Method:
  • Number of Running Instances:
  • DB Replicaset Oplog:
  • NodeJS Version:
  • MongoDB Version:
  • Proxy:
  • Firewalls involved:

Any additional Information

Not a very good suggestion but for me it worked.

  1. Remove users from any default channels if available.
  2. Stop the application.
  3. Login to mongo console with the authenticated user and run the below command:

use rocketchat
switched to db rocketchat
db.users.remove({“ldap”: true});

hope it helps.

2 Likes