# Find previously suspended users

**URL:** https://meta.discourse.org/t/find-previously-suspended-users/39551
**Category:** Support
**Created:** [14 فبراير 2016، 5:18ص UTC](https://meta.discourse.org/t/find-previously-suspended-users/39551 "2016-02-14T05:18:06Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [14 فبراير 2016، 5:18ص UTC](https://meta.discourse.org/t/find-previously-suspended-users/39551/1 "2016-02-14T05:18:06Z")

</div>

Is it possible to get a list of users who were suspended at one time or another (not neccessarily actively suspended)?

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [14 فبراير 2016، 1:59م UTC](https://meta.discourse.org/t/find-previously-suspended-users/39551/2 "2016-02-14T13:59:10Z")

</div>

I think you can use this in the [data explorer](https://meta.discourse.org/t/32566?silent=true) plugin

```plaintext
SELECT * FROM user_histories
  WHERE action = 10

```

I’m validating that 10 is suspended, but I believe it is.

And I found it is

> <https://github.com/discourse/discourse/blob/74f22f95da49709d6ec09eca8f23645c9ac7bc16/app/models/user_history.rb#L19-L29>

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [14 فبراير 2016، 9:47م UTC](https://meta.discourse.org/t/find-previously-suspended-users/39551/3 "2016-02-14T21:47:05Z")

</div>

OK, can it be done by a Moderator? To the best of my knowledge mods don’t have access to run queries.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [14 فبراير 2016، 10:40م UTC](https://meta.discourse.org/t/find-previously-suspended-users/39551/4 "2016-02-14T22:40:47Z")

</div>

No, it can’t. But if you give it to your Admin, they can create the query, and you could use a master API key to access the queried data

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [14 فبراير 2016، 10:42م UTC](https://meta.discourse.org/t/find-previously-suspended-users/39551/5 "2016-02-14T22:42:30Z")

</div>

Thanks @cpradio, this is less of an issue after I discovered that suspensions are logged…but no names are stored in logs. I would rather see a fix to that then need to bother the admins:

> [@Suspensions and Blocks do not give enough details in logs](https://meta.discourse.org/t/suspensions-and-blocks-do-not-give-enough-details-in-logs/39554):
>
> Summary: Exporting the staff logs and looking at suspensions and blocks does not show who the suspension/block was applied to. Automatic unsuspensions are not logged. Steps to reproduce: Suspend, block, un-suspend, or un-block at least one user. Visit /admin/logs/staff\_action\_logs Click Export Expected Results: Logs will show who each action was applied to. Actual Results: No user is given for each log entry. Automatic un-suspensions (due to a date being entered when suspended) are not…

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [19 ديسمبر 2018، 2:56م UTC](https://meta.discourse.org/t/find-previously-suspended-users/39551/6 "2018-12-19T14:56:13Z")

</div>



---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [19 ديسمبر 2018، 10:44م UTC](https://meta.discourse.org/t/find-previously-suspended-users/39551/7 "2018-12-19T22:44:22Z")

</div>

Is that still the case @jomaxro?

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [19 ديسمبر 2018، 10:49م UTC](https://meta.discourse.org/t/find-previously-suspended-users/39551/8 "2018-12-19T22:49:18Z")

</div>

I doubt it. That was 3 years ago, and the linked bug was fixed/closed. Will check to be sure.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [19 ديسمبر 2018، 11:09م UTC](https://meta.discourse.org/t/find-previously-suspended-users/39551/10 "2018-12-19T23:09:17Z")

</div>

Suspensions are definitely logged now, checked both `/admin/logs/staff_action_logs` and the downloaded CSV. Found a separate bug, but I’ll open a new topic for that.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [19 ديسمبر 2018، 11:09م UTC](https://meta.discourse.org/t/find-previously-suspended-users/39551/11 "2018-12-19T23:09:21Z")

</div>


