Delete multiple users by CSV with only their emails

Re: Delete multiple users by CSV with only their emails

by Luis de Vasconcelos -
Number of replies: 0
You cannot bypass usernames. Usernames are the unique user identifiers in Moodle.

Use a sql query like this to get the usernames for those email addresses:

SELECT username, email, firstname, lastname
FROM mdl_user
WHERE email IN (
'joe@gmail.com',
'jane@doe.com',
'jack.jill@thehill.com',
etc
)

Replace the emails with your 290 emails before you run that sql script. It will give you a list of all the usernames associated with the profiles you want to delete.

This is only useful if, for some reason, you don't want to use Randy's solution.