Integrate SMTP and LDAP into Moodle 2.1

SMTP

  1. Login to moodle as the admin
  2. Browse to Site administration  Plugins  Message outputs Email
  3. Keep the defaults except for the following two options:
  4. SMTP hosts: server.com
  5. No-reply address:
  6. Save your changes

LDAP

  1. Edit the php.ini file in C:\Program Files (x86)\PHP\v5.3and add the following line to the [ExtensionList] at the bottom:extension=php_ldap.dll
  2. As always, you’ll need to save the file to your desktop and then copy it over to C:\Program Files (x86)\PHP\v5.3
  3. Reboot your server!
  4. Login to moodle as the admin
  5. Browse to Site administration  Plugins  Authentication  Manage authentication
  6. Disable Email-based self-registration by clicking on the open eye
  7. Enable LDAP server by clicking on the closed eye
  1. Browse to Site administration  Plugins  Authentication LDAP server and set the following settings:

NOTE: Keep defaults if the setting is not specified below

  1. LDAP server settings
  2. Host URL:ldapserverIP
  3. Bind settings (Used to access AD)
  4. Hide passwords: Yes
  5. Distinguished Name:cn=changethisusername,ou=Company\20Administration,dc=company,dc=com
  6. NOTE: the \20 is used to specify a space in the container name
  7. Password: ch@ng3me
  8. User lookup settings
  9. User type: MS ActiveDirectory
  10. Contexts: ou=moodleusers,dc=company,dc=com
  11. Search subcontexts: Yes
  12. User attribute: sAMAccountName
  13. Force change password
  14. Force change password: No
  15. Password format: MD5 hash
  16. Course creator
  17. Creators: ou=faculty,ou=moodleusers,dc=company,dc=com
  1. Data mapping
  2. First name: givenname
  3. Surname: sn
  4. Email address: mail
  5. City/town: l
  6. Country: c
  7. Click on Save changes
  1. Create a Scheduled Task on the server to sync Moodle and AD
  2. Open the Server Manager (Start or Control Panel  Administrative Tools)
  3. Go to Configuration  Task Scheduler
  4. Click on Create Basic Task…
  5. Put in Sync AD with Moodle for the Name and Description
  6. Put in Daily for the Trigger
  7. Start time: 2:00:00 AM
  8. Recure every 1 day
  9. For Action select Start a program
  10. Program/script:: “C:\Program Files (x86)\PHP\v5.3\php.exe”
  11. Add arguments: –f “C:\inetpub\wwwroot\auth\ldap\cli\sync_users.php”
  12. Go into the Task Scheduler Library and Right-click the task and select Properties
  13. Genearl Tab
  14. UnderSecurity options, select Run whether user is logged on or not
  15. Under Security options, check Run with highest privileges
  16. Under Security options, check Do not store password…
  17. Configure for:Windows 7, Windows Server 2008 R2
  18. Settings Tab
  19. Check If the task fails, restart every:
  20. 15 minutes
  21. 3 times