Posted by wdennen on September 25, 2008 at 3:38pm
Hi, I have ldap authentication working with this module (http://drupal.org/project/ldap_integration).
It's working fine, if the user does not exist in drupal, it is created automatically upon login.
I would like to find some way to mass-create drupal accounts for all users in ldap, though.
Is there a way to do this? Thanks.

Comments
Mass user import
I would think you could do it by creating a script to loop through a user list and insert directly into the users table. You will need to allow for the serialized data that the ldap_integration module places in the data field (ex: a:4:{s:17:"ldap_authentified";i:1;s:7:"ldap_dn";s:58:"CN=username,OU=People,DC=domain";s:7:"contact";i:1;s:11:"ldap_config";s:30:"LDAP Server Settings Name";} )
Also, in Drupal 5, you will need to add to the sequences table for users. I don't think Drupal 6 uses sequences, but someone correct me if I am wrong on that.
Thanks,
Shrop
user import
There is a user import module, I even created some extensions to it (ldap and alt_login support), but I recommend against it. It really hosed our database. I finally got everybody completely imported after many tries and manual database cleanups.
Thanks
user import module sounds ideal, but your comments about it hosing the db are scary.
I suspect that this may be a regular need (importing users), and not a one-shot deal. So, maybe Shrop's suggestion is best.
LDAP problem
We had our users stored in LDAP, and the local server manager exported them to .CSV in groups (which made it easier for me to assign the right roles). Then I massaged the .CSV a bit so that it had the minimal fields necessary for a user (which is apparently user name + email) and successfully imported over 300 users without a glitch. Of course I tested it on a backup database first. Once we did that, it unfortunately created a second sign in for Drupal, largely because I was unclear of my server admin's ability to keep LDAP authentication running after I leave our school.
The problem here is that I was pretty sure that the LDAP encryption of passwords wasn't the same as the MD5 encryption Drupal uses, so all of the password information was lost, but that won't be an issue in your case since you aren't authenticating against Drupal's database anyway.
So the long and the short, the user import module has worked fine for me many, many times so this issue that dug had may have been a 1-off thing. Obviously testing the import on a 2nd database is key, and probably working in batches is a good idea as well.
Dave
User Import And LDAP Integration
http://drupal.org/project/user_import
The 5.x.2 branch of the User Import module has been developed as a framework for other modules to plug in to, and there is a patch for LDAP integration waiting to be tested. If I get enough good feedback on it I'll be happy to include it as part of the module.
http://drupal.org/node/275844
I can't respond to dug's comment that User Import 'hosed his database' without knowing the specifics, but I haven't seen any other report like that and the module is downloaded about 500 times a week, the feedback I've read is more like dwees comment above.