In the settings of the self-enrolment-method of each course you can define the max. no. of users. Doesn't that work?
Enrolment
How to enroll only 20 students into a course
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.