# Purge AD imported users from DB

**URL:** <https://forums.rocket.chat/t/purge-ad-imported-users-from-db/6005>\
**Category:** Community Support\
**Created:** [March 4, 2020, 1:02pm UTC](https://forums.rocket.chat/t/purge-ad-imported-users-from-db/6005 "2020-03-04T13:02:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gob](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/gob/32/1388_2.png) [@gob](https://forums.rocket.chat/u/gob)\
**Post date:** [March 4, 2020, 1:02pm UTC](https://forums.rocket.chat/t/purge-ad-imported-users-from-db/6005/1 "2020-03-04T13:02:06Z")

</div>

### Description

Whilst trying to get the LDAP group to channel functionality working I inadvertently imported over 4000 users, computers and groups etc.  
As there are only 100 or so active users on the rocketchat server I would really like to purge these ghost users.  
Is there an easy way to do that in the database? Say for any account that has never been logged in?  
I am using the snap install and default mongo DB that ships with the snap.

### Server Setup Information

- Version of Rocket.Chat Server: 2.4.11
- Operating System: Debian 9
- Deployment Method: snap
- Number of Running Instances: 1
- DB Replicaset Oplog:
- NodeJS Version: 8.17
- MongoDB Version: 3.6.14
- Proxy: nginx
- Firewalls involved: pfSense

### Any additional Information
