I'm helping an institution clean up their Moodle user directory. Several years ago they switched from one username format to another, and as part of the switch they created all-new Moodle accounts (with the new username format) for their students. However, they also kept all the old accounts on the same system, so that the students could access their old content.
Now, the institution is planning to clean out the old accounts for good - but they are starting out by suspending the old accounts in Moodle to prevent students from logging in to the wrong account. However, instructors can (and often do) manually enrol the wrong accounts into their course.
I've noticed that even if an account is marked as Suspended, or No Login, instructors can still manually enrol it. Suspending accounts at the course level won't help as this is most commonly a problem with new courses and enrolments.
I'm looking for a way to hide "flagged" accounts so that they don't show up in the manual enrolment dialog.
Any thoughts as to how I might accomplish this? We're running Moodle 3.5.1 at the moment