# Find devices with local admin account

**URL:** <https://discuss.rapid7.com/t/find-devices-with-local-admin-account/40598>\
**Category:** Log Search\
**Tags:** InsightVM, InsightIDR, workflow-building, vulnerability-management, queries\
**Created:** [August 2, 2024, 6:54pm UTC](https://discuss.rapid7.com/t/find-devices-with-local-admin-account/40598 "2024-08-02T18:54:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhernandez](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mhernandez](https://discuss.rapid7.com/u/mhernandez)\
**Post date:** [August 2, 2024, 6:54pm UTC](https://discuss.rapid7.com/t/find-devices-with-local-admin-account/40598/1 "2024-08-02T18:54:41Z")

</div>

I am trying to figure out if there is a way to find all devices that have a local admin account with a specific name. We are using InsightIDR, and InsightVM. I’ve been reading over the documentation, searching the log entries for the local admin username I’m looking for, and I’ve checked to see if anything in VM will show me that. So far my search has turned up nothing, even though I know that there are at least some devices with this specific user. Any insights as to whether this feature exists in Rapid 7? Thanks for any advice you may have.

---

<div class="post-metadata">

**Author:** ![iboje](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/i/bbce88/32.png) [@iboje](https://discuss.rapid7.com/u/iboje)\
**Post date:** [August 8, 2024, 7:04pm UTC](https://discuss.rapid7.com/t/find-devices-with-local-admin-account/40598/2 "2024-08-08T19:04:40Z")

</div>

If you have the license that includes velociraptor, you should be able to query all your devices with that. Something like this VQL command might work:

```auto
select * from users() where Name =~ 'administrator'

```

In IDR, it does look like each asset has a list of local users, but I’m not sure how to query the entire org for a specific username within the GUI. If you have good scripting skills, you may be able to get this using the API; some [docs here](https://help.rapid7.com/insightidr/en-us/api/v1/docs.html#tag/Local-Accounts/operation/searchLocalAccounts).

---

<div class="post-metadata">

**Author:** ![antmar904](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/a/d2c977/32.png) [@antmar904](https://discuss.rapid7.com/u/antmar904)\
**Post date:** [February 4, 2025, 8:05pm UTC](https://discuss.rapid7.com/t/find-devices-with-local-admin-account/40598/3 "2025-02-04T20:05:38Z")

</div>

This IVM SQL report worked well.  
It returns a excel sheet with all local accounts, you can just filter from there.

> SELECT  
> daua.name,  
> daua.full\_name,  
> da.ip\_address,  
> da.host\_name  
> FROM  
> dim\_asset\_user\_account daua  
> JOIN dim\_asset da using (asset\_id)

This was found here: [insightvm-sql-queries/sql-query-export/Users\_On\_Assets.sql at master · rapid7/insightvm-sql-queries · GitHub](https://github.com/rapid7/insightvm-sql-queries/blob/master/sql-query-export/Users_On_Assets.sql)
