This isn't really an LDAP issue per se, but hopefully someone might be able to advise.

I have LDAP working like I want it. I've taken a stab at the bulk User Import module to convert our old site's 2500 users to Drupal accounts, and testing there has gone well. I've also found that if I edit an imported user's account, it will provision out to the LDAP like I want it. However, editing 2500 accounts individually is suboptimal, so I was looking at just creating a script to loop through the imported users and ldap_add them. Looking at the createLdapEntry in the ldap_servers/LdapServer.class.php file, it seems like that's about what happens here, and I can get the $attributes array from debug to work from. But since I haven't reverse-engineered the whole thing, can anyone shed any light on what else might be happening under the hood on Drupal when the LDAP provisioning happens? Are some tables updated in some way that would be required by my script? It looks like the D6 version was accessing the "authmap" table but I don't think that's necessary anymore.

Comments

johnbarclay’s picture

Title: Bulk Provisioning » LDAP User: Bulk Provisioning of Drupal to LDAP Users

the ldap relationship between a drupal and ldap entry are stored in the user fields (the ldap_user_user_entity_fields() function lists them). I would think you would just want to loop through all the drupal users, load their accounts and call LdapUserConf->provisionLdapEntry().

You could put it in cron and have it work similarly to _ldap_user_orphans() function:
-- query the next 100 or so drupal users that aren't ldap associated
-- provision them with LdapUserConf->provisionLdapEntry(). (or just load and save the user if you have ldap user configred to provision to ldap on user save)
-- store the last uid checked in a variable for the next cron.

dolcaer’s picture

Have you gotten this to work? This is exactly what i need, but I'd prefer not writing a solution myself if someone else has already done it.

Edit: Nevermind, i read it the wrong way. What i mean to do is exactly the reverse, bulk provisioning LDAP to Drupal.

haggins’s picture

Issue summary: View changes

I just created a sandbox project which provides Drupal -> LDAP bulk provisioning by role via Batch API:

https://www.drupal.org/sandbox/haggins/2414219

larowlan’s picture

Status: Active » Closed (outdated)

no update for > 12 months - closing