Samuli,
I'm looking into doing something like this as well.
Looking at the Moodle API (http://moodle.org/mod/resource/view.php?id=1267) there is a function create_user_record() which I'm willing to bet would help.
The function call looks like this :
create_user_record($username, $password, $auth='')
My guess is you can setup the user with an auth type of "ldap" and a strong randomly encrypted password and that should do it.
I haven't tested this yet so I can't say it works, but I'll report back when I get something going.
Enrolment
Flat file enrolments and an LDAP authentication?
This discussion has been locked so you can no longer reply to it.