Thanks, Constance. This script returns all grades for currently enrolled users - that's the part I already have. I now need to get all grades for already unenrolled users (which have been in the course at one point and completed it). I do not want to enroll them again. Any ideas on that?