Is there a way to get a report that lists all those who have been assigned a given role? I'd like to get a list of all the Teachers on our system.
The attached report should do what you want.
Unzip it into your moodle folder, and it should add the files admin/report/userroles/index.php and one other.
It is not designed to work efficiently on huge sites, (it really needs to be made to print a paging bar if there are too many results returned), but it should be OK up to a few thousand users with a particular role.
Unzip it into your moodle folder, and it should add the files admin/report/userroles/index.php and one other.
It is not designed to work efficiently on huge sites, (it really needs to be made to print a paging bar if there are too many results returned), but it should be OK up to a few thousand users with a particular role.
Thanks a lot Tim - very helpful! 
To help others find your report, I've added a link to this discussion from the Course overview reports documentation. In addition, perhaps the report could be added to the modules and plugins database?

To help others find your report, I've added a link to this discussion from the Course overview reports documentation. In addition, perhaps the report could be added to the modules and plugins database?
Well, this version is just a quick hack, becuase I wanted to see how hard it was to write a report like this. When I get back from holiday I need to do a more sophisticated version for work, that also lets you get an overview all all the assignments for a particular user (perhaps only for selected roles) and then gives you an easy way to remove some of those enrollments. Currently, removing a teacher from 10 courses is a painfully slow manual process.
So, once it is in a better state, I will of course, put it in contrib and the MnP database.
So, once it is in a better state, I will of course, put it in contrib and the MnP database.
Debug report:
I did this on my own instance, not the production server, but I think the first problem I had was that question/upgrade.php did not exist. I must have an older version of Moodle installed.
So then I upgraded my moodle instance to the latest, downloaded today (Aug 25 2007) and get these errors (which, of course, make no sense to me!) I surely would like to have this report, so perhaps some of this will help you. I am using the Moodle4Windows install, so that is WAMP.
atw
Warning: Missing argument 2 for admin_externalpage_setup(), called in D:\moms_stuff\moodle_18\moodle\admin\report\userroles\index.php on line 16 and defined in D:\moodle_18\moodle\lib\adminlib.php on line 2603
Notice: Undefined variable: adminroot in D:\moodle_18\moodle\lib\adminlib.php on line 2616
Fatal error: Call to a member function locate() on a non-object in D:\moodle_18\moodle\lib\adminlib.php on line 2616
I did this on my own instance, not the production server, but I think the first problem I had was that question/upgrade.php did not exist. I must have an older version of Moodle installed.
So then I upgraded my moodle instance to the latest, downloaded today (Aug 25 2007) and get these errors (which, of course, make no sense to me!) I surely would like to have this report, so perhaps some of this will help you. I am using the Moodle4Windows install, so that is WAMP.
atw
Warning: Missing argument 2 for admin_externalpage_setup(), called in D:\moms_stuff\moodle_18\moodle\admin\report\userroles\index.php on line 16 and defined in D:\moodle_18\moodle\lib\adminlib.php on line 2603
Notice: Undefined variable: adminroot in D:\moodle_18\moodle\lib\adminlib.php on line 2616
Fatal error: Call to a member function locate() on a non-object in D:\moodle_18\moodle\lib\adminlib.php on line 2616
Hi Roger,
Did you manage to te this hack working? I've installed it on my site (1.8.2), and although under the "reports" menu, I get the option to click on userroles, I get a blank page on my local test machine OR HP 500 (Website cannot display the page) message.
JalilK