Integrate SMTP and LDAP into Moodle 2.1
SMTP
- Login to moodle as the admin
- Browse to Site administration Plugins Message outputs Email
- Keep the defaults except for the following two options:
- SMTP hosts: server.com
- No-reply address:
- Save your changes
LDAP
- 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
- 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
- Reboot your server!
- Login to moodle as the admin
- Browse to Site administration Plugins Authentication Manage authentication
- Disable Email-based self-registration by clicking on the open eye
- Enable LDAP server by clicking on the closed eye
- Browse to Site administration Plugins Authentication LDAP server and set the following settings:
NOTE: Keep defaults if the setting is not specified below
- LDAP server settings
- Host URL:ldapserverIP
- Bind settings (Used to access AD)
- Hide passwords: Yes
- Distinguished Name:cn=changethisusername,ou=Company\20Administration,dc=company,dc=com
- NOTE: the \20 is used to specify a space in the container name
- Password: ch@ng3me
- User lookup settings
- User type: MS ActiveDirectory
- Contexts: ou=moodleusers,dc=company,dc=com
- Search subcontexts: Yes
- User attribute: sAMAccountName
- Force change password
- Force change password: No
- Password format: MD5 hash
- Course creator
- Creators: ou=faculty,ou=moodleusers,dc=company,dc=com
- Data mapping
- First name: givenname
- Surname: sn
- Email address: mail
- City/town: l
- Country: c
- Click on Save changes
- Create a Scheduled Task on the server to sync Moodle and AD
- Open the Server Manager (Start or Control Panel Administrative Tools)
- Go to Configuration Task Scheduler
- Click on Create Basic Task…
- Put in Sync AD with Moodle for the Name and Description
- Put in Daily for the Trigger
- Start time: 2:00:00 AM
- Recure every 1 day
- For Action select Start a program
- Program/script:: “C:\Program Files (x86)\PHP\v5.3\php.exe”
- Add arguments: –f “C:\inetpub\wwwroot\auth\ldap\cli\sync_users.php”
- Go into the Task Scheduler Library and Right-click the task and select Properties
- Genearl Tab
- UnderSecurity options, select Run whether user is logged on or not
- Under Security options, check Run with highest privileges
- Under Security options, check Do not store password…
- Configure for:Windows 7, Windows Server 2008 R2
- Settings Tab
- Check If the task fails, restart every:
- 15 minutes
- 3 times