Good morning,
is there a way to list all users that are not in a course? I don't think this can be done from the admin gui but rather would be an SQL statement. Am I correct with that?
Would appreciate it someone could maybe write the SQL statement as I'm not realy up2date with the moodle db and what I would have to join to get the correct answer.
Thanks for your time,
Michael
$DB->get_records_sql('SELECT * FROM {user} u WHERE u.id NOT IN (SELECT userid FROM {useR_enrolments}))
You can try it.
Remember to remove admin or other user that you don't need, like admin, guest.
Cheers.
Please visit MDL-19190 and see if it reflects what you want to be able to do. If so, please vote for it.