Virtual Learning Platforms Thread, Moodle 2.1 LDAP Sync Users in Technical; Hi,
I am currently running Moodle 2.1 and have successfully established LDAP authentication so users registered in my Active Directory ...
-
21st August 2011, 06:11 PM #1
- Rep Power
- 0
Moodle 2.1 LDAP Sync Users
Hi,
I am currently running Moodle 2.1 and have successfully established LDAP authentication so users registered in my Active Directory can log on without needing to register.
I now would like to sync the 300+ users from AD to Moodle.
I have read alot about the 'sync_users.php' in C:\inetpub\wwwroot\Moodle\auth\ldap\cli but I cannot seem to run the file (done through a web browser using the Moodle pathway eg moodle2/moodle etc). I am given a blank white screen. When I decided to edit it I added in the config.php location and finally got "Command line scripts can not be executed from the web interface".
Other forums suggest this should be run through Cron, which I have established as a Scheduled task every 5mins, I do not know how to add the sync_users.php to the Cron jobs however.
Please can somebody help.
Thank You
-
-
IDG Tech News
-
21st August 2011, 06:24 PM #2 You need to add a scheduled job to run the cli version of php. Assuming a windows server from the paths you gave you need to find where php.exe is, and schedule it to run with a command line argument of the full path to the sync_users.php file.
-
-
21st August 2011, 07:37 PM #3
- Rep Power
- 0
Hi,
thank you for your response. Yes I am using Windows Server.
I believe the php is here: C:\Program Files (x86)\PHP\v5.3\php.exe
The sync-users is here: C:\inetpub\wwwroot\Moodle\auth\ldap\cli\sync_users .php
Would you be able to help with the Command Line argument I would require please?
Thank You
-
-
28th September 2011, 10:12 AM #4
- Rep Power
- 0

Originally Posted by
r0b0c0p
I believe the php is here: C:\Program Files (x86)\PHP\v5.3\php.exe
The sync-users is here: C:\inetpub\wwwroot\Moodle\auth\ldap\cli\sync_users .php
Would you be able to help with the Command Line argument I would require please?
Thank You
Hi,
I believe I am experiencing similar problems to you, if you've progressed any I would appreciate an update
I have a working Moodle 2.1.1 Site with LDAP Auth working & even had NTLM/Single Sign-on working nicely at one point (however thats broken again atm
) LDAP Auth is still working nicely, but I can't seem to get it to populate the Moodle User List with our users from AD? - I assume this needs to be done so users can be enrolled in courses etc?
RE: the command line argument you were after, having done some research, I believed the correct command for my server environment was the following:
Code:
C:\PHP\PHP.exe -f "C:\moodle\server\moodle\auth\ldap\cli\sync_users.php"
However... I tried this command and it paused (appeared to be doing something) then said:
Code:
Connecting to LDAP Server...
And that was all, took a few seconds but unfortunately it didn't populate my user-list as I was expecting. 
You might want to try this command on your server:
Code:
"C:\Program Files (x86)\PHP\v5.3\php.exe" -f "C:\inetpub\wwwroot\Moodle\auth\ldap\cli\sync_users.php"
I'd greatly appreciate any input from anyone in the know about Moodle / LDAP Integration & populating users lists so you can enrol users etc. Thanks for your time & help in advance.
-
-
8th March 2012, 03:25 AM #5 We found we had to do was in the Moodle > LDAP config, we had to add data mappings for all of the required fields (eg Firstname, Lastname, Mail, Location) and have that information up to date in AD so that when it creates the accounts, it can have the email address already established.
We have a batch script that runs the following:
Code:
C:\php\php -d memory_limit=512M -d log_errors=1 -d error_reporting=E_ALL -d display_errors=0 -d html_errors=0 -d error_log=C:\scripts\syncfile-errors.log -f D:\web\applications\moodle\auth\ldap\cli\sync_users.php > c:\scripts\MoodleUserSync.log
Its been a while since it was set up, but it seems to mostly do the trick. It calls php.exe then runs the moodle\auth\ldap\cli\sync_users.php, and then logs the details to C:\scripts\moodleusersync.log. It actually logs a lot of detail about the syncing process (eg users created, users suspended, users restored) but its not great for troubleshooting when some users don't sync properly.
For sites > 1000 users, you may need to increase the "MaxPageSize" in AD so that it returns more than 1000 users (info: http://docs.moodle.org/22/en/LDAP_au...ion_using_cron)
Last edited by OutLawTorn; 8th March 2012 at 03:34 AM.
-
SHARE:
Similar Threads
-
By FN-GM in forum Virtual Learning Platforms
Replies: 14
Last Post: 4th May 2012, 02:10 PM
-
By climo in forum Virtual Learning Platforms
Replies: 0
Last Post: 16th August 2011, 09:55 AM
-
By reggiep in forum Virtual Learning Platforms
Replies: 2
Last Post: 5th January 2010, 09:33 PM
-
By davipton in forum Virtual Learning Platforms
Replies: 2
Last Post: 17th June 2009, 01:59 PM
-
By gshaw in forum Virtual Learning Platforms
Replies: 1
Last Post: 12th June 2009, 11:11 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules