Hello people,
I've developed a small script that might be useful for some people. What it does is that it goes through the courses of a category and checks whether the students or teachers are enrolled in a specific cohort.
You may find the script in here: https://github.com/marios152/checkcohort
This was tested in moodle 3.0 onward. i am pretty sure it will work in older versions as well but i didn't test it.
Cheers.
PS. In case you have any suggestions or improvements for this script please let me know.
Marios
Peace & Love