Hi,
When we rename users in AD (normally when they get married) in Moodle they are given fresh accounts rather than renaming the old one. Does anyone know how to make it rename? maybe @penfold_99 knows
Thanks

Hi,
When we rename users in AD (normally when they get married) in Moodle they are given fresh accounts rather than renaming the old one. Does anyone know how to make it rename? maybe @penfold_99 knows
Thanks
Nope, not afaia - the tie is done on username so if the username changes, then it's new account time. When a user logs in to an LDAP-enabled Moodle, it looks at the username you've tried to log in with and checks whether it exists in Moodle. If it doesn't, it checks against AD and if it finds it there then it creates a new Moodle account.
The only way is to manually change the Moodle username BEFORE they next login to Moodle but after you've changed their account in AD.
I use MySQLFront and BulkADUsers on desktop which makes it quick n' easy to change both tables via GUI. Alternatively, you could use ADLDAP for PHP and knock up a web interface to enter the change thru, and let the PHP pixies make the changes in both AD and MySQL/PostgreSQL simultaneously...
Last edited by Marci; 16th August 2012 at 08:53 AM.


Can you get it look for a different AD attribute please?
What version of moodle? There are ldap sync scripts kicking about that you could use... trigger it via cron every evening to keep things up to date...
Using Moodle: LDAP sync users - what to do if LDAP search limits the # of records it'll return
Using Moodle: LDAP Mass sync users
Set up a bookmark for your data team to load whenever they change a username for instance.
Have a look at the ldap authentication settings guide at http://docs.moodle.org/23/en/LDAP_authentication - you can change the user attribute to look at a different field in AD if required.
Last edited by Marci; 16th August 2012 at 05:42 PM.

We are on 2.2 i already run the LDAP sync every night.
What would i change to make it look at something else other than the usernames for the user accounts?

Not tried this is 2.x but in 1.x you could edit the username in the database directly using something like phpmyadmin. You would just need to delete the second account.


Well each of our users has a unique attribute in AD. Can we use this instead of the username to cross reference to accounts? Then they will be no problems when the accounts are automatically renamed in AD.
Thanks
Last edited by FN-GM; 16th August 2012 at 09:02 PM.
Do your users know what that unique attribute is(?), as that would have to become their Moodle log in, then you just change the User Attribute within LDAP Settings to match that unique attribute.

Can't change it then... best suggestion I can make without delving into a full-on PHP automated solution is the bookmark to the sync script, and get whoever manages data to hit it whenever they've made a change.

What a pain. I have booked a meeting with other people in School to see if we can change all staff usernames to a system where they wont change at all. Students user names are all numbers so we dont have this issue.
Thanks

This is why we just use first names unless there is more than one of the same for teachers as they have this nasty habit of getting married, changing their names and screaching about their email addresses and logons the very next day. Much easier to just use first names as they hardly ever change.
There are currently 1 users browsing this thread. (0 members and 1 guests)