# IAM.USER.LIST

> List who has roles, and which.

URL: https://docs.hotkv.com/commands/iam-user-list/

```
IAM.USER.LIST
```

- Group: IAM
- Complexity: O(N) where N is the number of principals
- HotKV Cloud: not available
- On-Premise: requires the enterprise-iam license feature

`IAM.USER.LIST` returns every principal that has a role (a user name,
`ldap:name`, `oidc:name` or `group:name`), sorted, each with its roles.

## Return value

An array in RESP2 and RESP3, with one element per principal: an array of the
principal as a bulk string, and an array of its roles. An empty array if nobody
has a role. Without a license that includes `enterprise-iam` the reply is the
error `NOLICENSE enterprise-iam requires a HotKV license. Contact sales@hotkv.com`.

## Examples

```
127.0.0.1:6379> IAM.USER.LIST
1) 1) "group:cn=ops,ou=groups,dc=example,dc=com"
   2) 1) "admin"
2) 1) "group:developers"
   2) 1) "app"
3) 1) "oidc:bob"
   2) 1) "reporting"
```

## Compatibility

HotKV-only command.

## See also

[IAM.USER.ASSIGN](https://docs.hotkv.com/commands/iam-user-assign/index.md), [IAM.USER.UNASSIGN](https://docs.hotkv.com/commands/iam-user-unassign/index.md),
[IAM.ROLE.INFO](https://docs.hotkv.com/commands/iam-role-info/index.md)