I'm interested on a solution too, because I'm not very familiar with db handling.
And I would like to have functionality of automatic deleting users after a given period of inactivity in addition to Clint's question.
Thanks a lot
Saludos. Iñaki.
Hello,
I also have over 100 users I want to delete. I don't want to have to delete each one manually. Is there a quick way to delete the whole lot.
Thanks
Nicola.
I'll also be needing the ability to delete multiple users at the same time, the idea of having check boxes next the users so you can select more than one at a time sounds good to me.
I like the check box suggestion - that would be good. Any news on this development wouldbe appreciated - we have 100s of student accounts we would like to delete. Any help appreciated 
This would, indeed, be a very useful, much needed feature. Has anyone filed a request at http://tracker.moodle.org/?
I do not see it in the list of features already requested - http://tracker.moodle.org/secure/IssueNavigator.jspa?mode=hide&requestId=10283
You can delete students from courses, of course, but this does not remove their accounts completely.
Regards,
Art
I've just filed a request - if anyone would like to go and vote for it, which might move it up the priority list a bit, it's at http://tracker.moodle.org/browse/MDL-10020
Chris
However it doe not do the job right. Out of 50 selected users to delete only two or three are deleted it seems randomly....
Wijnhold Bolt
It looks like there are problems when different users are to be deleted who have the same (fake) email address.
To avoid this problem in future we will all fake emailaddresses which we used like fill_your_email_address@here_in replaced with unique random adresses. When a user after a certain time is not using his account we will then delete the account.
It is taking me forever.
Please follow these steps. Go to...
Site Administration>Users>Accounts>Bulk User Actions
Add to selection the users you want to delete from Available list to to Selected list.
Choose Delete against With selected users and press Go.
Thank you!
If my understanding is right about the above conversations, you all looking for a way to delete multiple user accounts at same time.
I don't know why such a big thread for this question, and i wonder so many people facing same problem.
actually there is a solution.
In admin interface you can deleted multiple accounts using bulk user action.
( Users -> Accounts -> Bulk User Actions )
over there select all the users which you want to delete and then click " add to selection " button, Now you will see all the selected users appear in the selected column and select the Delete option from "With selected users" list box.
And after a confirmation there you go " Deleted multiple users at same time "
and regarding the check box suggestion which was give above , i think there is no need for that, in check box you are going to tick it and in list available presently you are going to select it using Ctrl key or Shift Key to do multiple.
Do reply me if you find this useful or message me back if i didnt address your requirements properly due to misunderstanding
The delete multiple users is a great function, but I wish that you could choose to NOT delete people then do a bulk removal.
For example I can select anyone who has status as a student somewhere on the site and delete them, but some of our staff are students and it will delete them completely which is no good for the sites they teach on.
But if there were an option for 'is not' teacher then I could combine the search to ONLY get those persons who have no other role than that of a student.
Am I asking too much do you think?
This doesn't actually work, it removes people from Moodle but leaves them in the database which is practically useless.
I've just dropped 3500 old users from the databse - which feels like the cleanest way to do it.
I want users to be deleted from the database as they are removed from our Active Directory. We are successfully using LDAP and have CRONS setup to do it but it's not working.
Does anyone have any ideas/thoughts?
Cheers
Being able to delete multiple users would be great My understanding may be wrong, but it makes sense that the rows in the database should remain there even when the account is deleted.
Suppose that as a teacher, I have create a course, uploaded lots of work and set it up nicely... Later on I leave the school and someone else takes over my job. Now moodle knows that my account (ID=321) entered all that stuff. If the row from the users table is deleted, the database now has 2 options - leave things as is, but this then leaves inconsistencies in the database. If they want to look up "who uploaded X" then they would never be able to tell that it was my accout. On the other hand, to avoid inconsistencies, the database could delete everything that points to my account. This is obviously not desirable as they would now lose all the work that I've done for them.
I think that any orphaned row in the users table - one that is not referenced anyware in the site - would be save to delete, but otherwise it would be a very bad idea. It seems like a lot more work than is necessary, rather just mark the "deleted" column with a 1.
Most systems work like this to help keep the data consistent.
Hi!!
I have a problem that I can't solve yet. Moodle version 3.0.2
I need to delete 1500 users from my Moodle site. I don't need to conserve nothing of their activity, logs, anything. The problem is that when I try to delete them from user bulk (/admin/user/user_bulk.php) such as upload users tool (admin/tool/uploaduser/index.php) or delete manually, one to one, occurs the error I share in file attachment.
I restarted courses in which users where matriculated before trying to delete users from the platform. Could this be the problem? Do you know how to fix it? I understand that delete rows from mdl_user table on database is not an option and it could crash de whole site, right?
Excuse me if my English is not the best, I hope you can undertand me, and I find a solution!
Thank you all!
Ravi,
Thanks for this. Excellent. I am a bit embarrassed that I did not consider this before. GOLD standard!!
Hi
When that option selects gives the following message
"Only lowercase letters allowed
More information about this Error"
Any way to solve it?
I'm looking for info on this as well...TEN YEARS after this original post was posted...and still this is an issue. And I wanted to point out that the bulk user option is useless to me because it ONLY gives the student name.
I am deleting spam accounts, and I am identifying the spammers by other info on their accounts...their name alone is useless to me. So in order to use the bulk option I first would still have to create a list of all the names to delete. PAIN IN THE ASS.
It would be SO MUCH BETTER if they'd just add a friggin check box to that list of users so I can just delete in bulk on that list!!
WHY, after all this time, is this STILL not an option??? Or am I just missing something...because so far all I'm seeing is the useless (to me, in my situation) bulk user option...and then going through my list one by one and x'ing out all my spammers one.at.a.time option. SOOOOO time consuming!!!
SIGH!!!