Showing grades for unenrolled users

I have a few clients in the academic space using Moodle. At the end of each year they reset their courses in preparation for the new academic year. This reset includes removing all student data from the course using Moodle’s Reset course function. The question I was asked, was how could they remove the students…