+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 23
Virtual Learning Platforms Thread, Moodle - renaming users in AD creates a seperate account in Moodle in Technical; Hi, When we rename users in AD (normally when they get married) in Moodle they are given fresh accounts rather ...
  1. #1

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,234
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462

    Moodle - renaming users in AD creates a seperate account in Moodle

    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

  2. #2
    Marci's Avatar
    Join Date
    Jun 2008
    Location
    Wakefield, West Yorkshire
    Posts
    896
    Thank Post
    84
    Thanked 235 Times in 194 Posts
    Rep Power
    82
    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.

  3. #3

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,234
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462
    Quote Originally Posted by Marci View Post
    Nope - 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...
    Ah the problem is AD is automatically updated when SIMS is. Might have to find another way around this.

  4. #4

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,234
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462
    Can you get it look for a different AD attribute please?

  5. #5
    Marci's Avatar
    Join Date
    Jun 2008
    Location
    Wakefield, West Yorkshire
    Posts
    896
    Thank Post
    84
    Thanked 235 Times in 194 Posts
    Rep Power
    82
    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.

  6. #6

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,234
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462
    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?

  7. #7

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,821
    Thank Post
    272
    Thanked 1,140 Times in 1,036 Posts
    Rep Power
    350
    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.

  8. #8

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,234
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462
    Quote Originally Posted by glennda View Post
    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.
    You can do it within moodle. But AD accounts are automatically renamed, it wold be good to have something that will be fully automated.

  9. #9
    penfold_99's Avatar
    Join Date
    Feb 2008
    Location
    East Sussex
    Posts
    985
    Thank Post
    58
    Thanked 165 Times in 117 Posts
    Rep Power
    68
    Quote Originally Posted by FN-GM View Post
    You can do it within moodle. But AD accounts are automatically renamed, it wold be good to have something that will be fully automated.
    I believe it's possible to automate this but it would need additional applications in place to manage it.

    There is a logical way to match everything together but would need to know the use case more to understand if there were exceptions to the rules.

  10. #10

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,234
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462
    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.

  11. #11
    Marci's Avatar
    Join Date
    Jun 2008
    Location
    Wakefield, West Yorkshire
    Posts
    896
    Thank Post
    84
    Thanked 235 Times in 194 Posts
    Rep Power
    82
    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.

  12. #12

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,234
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462
    Quote Originally Posted by Marci View Post
    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.
    They dont no, i would rather use the proper username as the login.

    Thanks

  13. #13
    Marci's Avatar
    Join Date
    Jun 2008
    Location
    Wakefield, West Yorkshire
    Posts
    896
    Thank Post
    84
    Thanked 235 Times in 194 Posts
    Rep Power
    82
    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.

  14. #14

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,234
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462
    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

  15. #15

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,241
    Thank Post
    882
    Thanked 2,743 Times in 2,317 Posts
    Blog Entries
    11
    Rep Power
    784
    Quote Originally Posted by FN-GM View Post
    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.

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 1st June 2012, 10:43 AM
  2. Script to create/update users in AD
    By IrritableTech in forum Scripts
    Replies: 2
    Last Post: 28th March 2012, 11:46 AM
  3. Creating new users in AD - Not creating profile folder
    By Svarcy in forum Windows Server 2008
    Replies: 4
    Last Post: 20th September 2011, 12:27 PM
  4. 'Could not create guest user account!!!' in Moodle
    By networkingNut in forum Virtual Learning Platforms
    Replies: 0
    Last Post: 17th May 2011, 10:52 AM
  5. Creating mailboxes in exchange 2007 when a user is created in AD on another server
    By thesk8rjesus in forum Network and Classroom Management
    Replies: 2
    Last Post: 5th September 2008, 02:53 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •