When you upload students to Moodle, you can add them to a cohort.
After you have all the students in a cohort, you can quickly enroll and unenroll them in courses just by synchronizing the cohort to the course. If you will upload students in bulk, consider putting them in a cohort. This makes it easier to manipulate them later.
Here's an example of a cohort. Note that there are 1204 students enrolled in the cohort:
These students were uploaded to the cohort under Administration | Site administration | Users | Upload users:
The file that was uploaded contained information about each student in the ...