unenroll users with bulk upload? M2

unenroll users with bulk upload? M2

by faruq f -
Number of replies: 4

I can enrol users on particular courses with bulk upload, but can I unenrol users with bulk upload?

If not, any alternative ideas to say unenrol 600 users from total of 4000 enrolled on a course are welcome?

Average of ratings: -
In reply to faruq f

Re: unenroll users with bulk upload? M2

by Christoph Ruda -

Hi Faruq,

As far as I know you can unenroll users with a csv file (Upload users). In addition to the required information (username, firstname, lastname, email) you will need to include a column titled deleted. The value for users that you want to unenroll from the system has to be set to 1.

It's all in MoodleDocs wink (even if the page below refers to Moodle 2.0 it works on previous versions too).

http://docs.moodle.org/20/en/Upload_users#Deleting_accounts

Hope this helps

Christoph

In reply to Christoph Ruda

Re: unenroll users with bulk upload? M2

by faruq f -

Thanks christoph,

But as far as I'm aware this delete a user, not unenrols them from a specific course.

In reply to faruq f

Re: unenroll users with bulk upload? M2

by Luis de Vasconcelos -
Picture of Particularly helpful Moodlers

Look at the Flat_file documentation.

You just specify the "DEL" command in the enrolments.txt file for each of the students that you want to unenrol.

Example:

del,student,730501,CF101

del = the command to unenrol the student.

student = the current role that the user has in the course. Usually student for students.

730501 = the students id number. This is the ID Number field in the students Moodle profile.

CF101 = the course that you want to unenrol the student from.

Put the enrolments.txt file containing the above unenrolments in your /moodledata/1/ folder (or whatever path you've specified under Site administration > Plugins > Enrolments > Manage enrol plugins) and the students will be unenroled the next time that the Moodle Cron job runs.

Average of ratings: Useful (1)
In reply to Luis de Vasconcelos

Re: unenroll users with bulk upload? M2

by faruq f -

thanks, that cron stuff is heavy, but i'll look in to it...