Bulk Updates to User Authentication in #Moodle
|Image Source: http://wamsoftinc.com/images/authenticate.jpg|
Wondering what steps to take to change the way users "authenticate" in Moodle from LDAP to Manual or vice versa? Sometimes, it's necessary to do mass updates to your users that you don't want to do one by one and/or the bulk update tool isn't appropriate.
In the screenshot above, notice that "auth" column reflections how users are authenticating in Moodle. You can change that authentication in one fell swoop rather than going one by one...this is handy when you're dealing with more than 20 users.
To switch authentication in bulk, you can do that in a tool like PHPMyAdmin. I had to do that once or twice before we switched to LDAP authentication for students.
Some SQL commands to find and update user authentication....
To FIND users (the WHERE command is critical since what you find is what you can update):
- SELECT * FROM `mdl_user` WHERE auth='manual'
This will give you a list of everyone who has authentication set to manual. You could switch 'manual' to 'ldap' and get corresponding results.
- UPDATE 'mdl_user'
This update command will change everyone who is LDAP authenticated to manual. If you switch 'ldap' with 'manual' you will get the opposite result.
As always, while it's fun to play with MySQL commands, make sure to make a backup of the mdl_user table (SQL dump) before starting down this road.
Get Blog Updates via Email!
Everything posted on Miguel Guhlin's blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure