# How do i, as Admin, pull list of all user's roles without requiring their passwords!?

**URL:** <https://forum.inductiveautomation.com/t/how-do-i-as-admin-pull-list-of-all-users-roles-without-requiring-their-passwords/75846>\
**Category:** Ignition\
**Created:** [July 3, 2023, 1:55pm UTC](https://forum.inductiveautomation.com/t/how-do-i-as-admin-pull-list-of-all-users-roles-without-requiring-their-passwords/75846 "2023-07-03T13:55:25Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ian.sebryk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ian.sebryk/32/49319_2.png) [@ian.sebryk](https://forum.inductiveautomation.com/u/ian.sebryk)\
**Post date:** [July 3, 2023, 1:55pm UTC](https://forum.inductiveautomation.com/t/how-do-i-as-admin-pull-list-of-all-users-roles-without-requiring-their-passwords/75846/1 "2023-07-03T13:55:25Z")

</div>

if i want a list of users and their roles, how do i pull that list _without_ (and this boggles me) requiring their passwords? from what i can glean, `system.security.getUserRoles()` takes not only `username` as a param, but also that user's `password`, which, as a SecEng makes my eyes pop. so i know i am missing something here. i should be able, **as an Admin** , to poll user data without compromising their credentials this way. i neither need nor want to have access to user credentials.

EDIT: corrected copy/paste error.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [July 3, 2023, 2:00pm UTC](https://forum.inductiveautomation.com/t/how-do-i-as-admin-pull-list-of-all-users-roles-without-requiring-their-passwords/75846/2 "2023-07-03T14:00:21Z")

</div>

> [@ian.sebryk](#):
>
> `system.user.getUserRoles()`

Where did you find that function ?

Anyway, you can use `system.user.getUser` and call the returned object's `.getRoles` method.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [July 3, 2023, 2:02pm UTC](https://forum.inductiveautomation.com/t/how-do-i-as-admin-pull-list-of-all-users-roles-without-requiring-their-passwords/75846/3 "2023-07-03T14:02:44Z")

</div>

You could use the management component in Vision, or download the exchange resource for Perspective (not sure which you are using as you didn't flag your post)

[https://docs.inductiveautomation.com/display/DOC80/Managing+Users+and+Roles#ManagingUsersandRoles-ManagingUsers](https://docs.inductiveautomation.com/display/DOC80/Managing+Users+and+Roles#ManagingUsersandRoles-ManagingUsers)

> **[Ignition Exchange](https://inductiveautomation.com/exchange/2128/overview)**
>
> Discover, share, and download community made Ignition resources in collaboration with your organization or the Ignition community.

---

<div class="post-metadata">

**Author:** ![ian.sebryk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ian.sebryk/32/49319_2.png) [@ian.sebryk](https://forum.inductiveautomation.com/u/ian.sebryk)\
**Post date:** [July 3, 2023, 2:38pm UTC](https://forum.inductiveautomation.com/t/how-do-i-as-admin-pull-list-of-all-users-roles-without-requiring-their-passwords/75846/5 "2023-07-03T14:38:18Z")

</div>

apologies! copy/paste malfunction. should read `system.security.getUserRoles()`

---

<div class="post-metadata">

**Author:** ![ian.sebryk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ian.sebryk/32/49319_2.png) [@ian.sebryk](https://forum.inductiveautomation.com/u/ian.sebryk)\
**Post date:** [July 3, 2023, 2:41pm UTC](https://forum.inductiveautomation.com/t/how-do-i-as-admin-pull-list-of-all-users-roles-without-requiring-their-passwords/75846/6 "2023-07-03T14:41:32Z")

</div>

i'll read through it, but cursory peek does not appear to satisfy the programmatical reqs. i'm not interested in a UI; i need to pull this data in and work with it in subsequent code. requiring user input is not possible for this context. regardless, thank you for the resource.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 3, 2023, 2:44pm UTC](https://forum.inductiveautomation.com/t/how-do-i-as-admin-pull-list-of-all-users-roles-without-requiring-their-passwords/75846/7 "2023-07-03T14:44:43Z")

</div>

Use pascal's first suggestion.

---

<div class="post-metadata">

**Author:** ![ian.sebryk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ian.sebryk/32/49319_2.png) [@ian.sebryk](https://forum.inductiveautomation.com/u/ian.sebryk)\
**Post date:** [July 3, 2023, 3:11pm UTC](https://forum.inductiveautomation.com/t/how-do-i-as-admin-pull-list-of-all-users-roles-without-requiring-their-passwords/75846/8 "2023-07-03T15:11:59Z")

</div>

but this still requires that i KNOW the user's username. i want to simply poll the project and pull the list of users associated with it, then determine their roles. at present, i can either do that for the currently logged-in user (me, whoopee.) or, i have to provide a username (prognostically determined).

we have, literally, thousands of users. there's no way i am going to keep a list of them all to manually feed into downstream funcs. i fully realize and accept that my Python experience is more of a handicap to me at this point. and i also accept that i am jumping right into the pool, water-wings be damned. but this very basic thing should still be straight-forward and simple, no? if not, not an issue; please educate me.

i should also mention, we do not use Vision at all. exclusively Perspective.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [July 3, 2023, 3:12pm UTC](https://forum.inductiveautomation.com/t/how-do-i-as-admin-pull-list-of-all-users-roles-without-requiring-their-passwords/75846/9 "2023-07-03T15:12:43Z")

</div>

Maybe this will help:

```auto
user = system.user.getUser("default", "admin")
print user.roles

users = system.user.getUsers("default")
print users

for user in users:
	print user.roles

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 3, 2023, 3:22pm UTC](https://forum.inductiveautomation.com/t/how-do-i-as-admin-pull-list-of-all-users-roles-without-requiring-their-passwords/75846/10 "2023-07-03T15:22:34Z")

</div>

If you bothered to look up `system.user.getUser()` in the manual, it would have been hard to miss `system.user.getUsers()` right below it.

🤷‍♂️

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [July 3, 2023, 4:02pm UTC](https://forum.inductiveautomation.com/t/how-do-i-as-admin-pull-list-of-all-users-roles-without-requiring-their-passwords/75846/11 "2023-07-03T16:02:07Z")

</div>

> [@ian.sebryk](#):
>
> but this very basic thing should still be straight-forward and simple, no?

It is. But as most simple and straight forward things, you need to know it's there. Which is why it's important to carefully read the doc, and particularly the functions' page in this case.

---

<div class="post-metadata">

**Author:** ![ian.sebryk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ian.sebryk/32/49319_2.png) [@ian.sebryk](https://forum.inductiveautomation.com/u/ian.sebryk)\
**Post date:** [July 3, 2023, 4:16pm UTC](https://forum.inductiveautomation.com/t/how-do-i-as-admin-pull-list-of-all-users-roles-without-requiring-their-passwords/75846/12 "2023-07-03T16:16:44Z")

</div>

make no mistake, i am very willing to read the docs. knowing what the hell i am looking for is another thing altogether. i wish i had several weeks to sit and read from start to finish; i do not. i have three days. and the guy before me didn't document ANYTHING. so, yes. my questions are seemingly stupid and misguided. but i haven't the luxury i normally would. i literally started five days ago having never touched Ignition. so it's a bit of a fun-sandwich... so big thanks to @ jlandwerlen for just getting right to it, and a nod of appreciation to @ pascal.fragnoud who recognized that i didn't even know where to look in the first place. i am running on shitty code, no documentation, and Ignition noob-juice.
