Our organization requires that we audit privileged users in our Moodle instance every quarter. I'd like to automate this, so I've been trying to find a way to generate a list of users by role (in any context) via command line.
I looked through the core Moodle CLI functions and haven't found anything that does what I'm looking for.
Another possibility is to just run a MySQL query against the database. However, I haven't been able to work out the correct query to do this in Moodle's schema as of yet.
I'm wondering if I'm missing something or if anyone has any suggestion on places to look?
We're using Moodle 3.9.11 on a RedHat server.