This is all pseudo-code, but it would work, depending on which scripting language you like to use (bash, php, ruby, python, etc.):
1) Make a text file with each student's identification string/username, one per line. Should be able to export something like this out of AD or OD.
2) In the...