# How to delete users from de DB

**URL:** <https://forums.rocket.chat/t/how-to-delete-users-from-de-db/5655>\
**Category:** Community Support\
**Created:** [January 30, 2020, 6:30pm UTC](https://forums.rocket.chat/t/how-to-delete-users-from-de-db/5655 "2020-01-30T18:30:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodgaray](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/rodgaray/32/1466_2.png) [@rodgaray](https://forums.rocket.chat/u/rodgaray)\
**Post date:** [January 30, 2020, 6:30pm UTC](https://forums.rocket.chat/t/how-to-delete-users-from-de-db/5655/1 "2020-01-30T18:30:35Z")

</div>

### 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

---

<div class="post-metadata">

**Author:** ![alogicking](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@alogicking](https://forums.rocket.chat/u/alogicking)\
**Post date:** [April 22, 2020, 10:34am UTC](https://forums.rocket.chat/t/how-to-delete-users-from-de-db/5655/2 "2020-04-22T10:34:00Z")

</div>

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.
