by Ken Task.
moosh
https://moodle.org/plugins/view.php?id=522
https://moosh-online.com/commands/
https://moosh-online.com/commands/#course-reset
moosh course-reset -s "unenrol_users=5,6" 17Users above is role ID. Could do a looping shell script that loops through course ID's - last number in command above.
'SoS', Ken