Yes, you CAN share your Address Book with LDAP!

rharder

Do not read this sign.
It's a round-about way, and I'm writing an AppleScript to make it easier, but basically you can use the 'nicl' command to create a NetInfo database that consists wholly of your Address Book names, emails, and phone numbers. Then you tell your /etc/openldap/slapd.conf file to read this "NetInfo" datasource, and voila: your Address Book is available to other family members, work associates, hackers, etc. Of course you don't get live updates as you update your Address Book, but you can always "sync" your phony NetInfo database file whenever you need to.

If you want to jump the gun, start playing around with commands like this:
Code:
% [b]nicl -raw addressbook.nidb -create[/b]
% [b]nicl -raw addressbook.nidb -create /users[/b]
% [b]nicl -raw addressbook.nidb -create /users/id1234[/b]
% [b]nicl -raw addressbook.nidb -create /users/id1234 realname "John Doe"[/b]
% [b]nicl -raw addressbook.nidb -create /users/id1234 mail [email]john@doe.com[/email][/b]
% [b]nicl -raw addressbook.nidb -create /users/id1234 phonenumber 444-555-1212[/b]

I'll post the AppleScript as soon as I finish it. I'm maybe a day or two away.

-Rob
 
Yes, that's how Apple uses it, if you have it configured that way for your network. You can have your login name and password served up from an LDAP server or something, but for the rest of us, it can be useful to share our addressbook with other users (like family).

Attached is the script. It creates an AddressBook.nidb folder in your Documents folder (you can move it). Then you update your /etc/openldap/slapd.conf file to point to that AddressBook.nidb folder instead of /var/db/netinfo/network.nidb, and voila you have an LDAP server giving up your email and phone numbers. Of course you have to start the ldap server with something like sudo /usr/libexec/slapd or by adding LDAPSERVER=-YES- to /etc/hostconfig and restarting.

-Rob
 

Attachments

  • address book to ldap.sit.zip
    27.9 KB · Views: 64
I've refined the script a bit. Cheers.

-Rob
 

Attachments

  • address_book_to_ldap_sit.zip
    27.9 KB · Views: 96
You might find ABxLDAP very useful to keep you LDAP directory updated. It synchronised your LDAP directory as / when changes are mode to the clients local Address Book. Instructions for configuring and using LDAP on both OS X and OS X server are also available on the web site, although some require a medium level of comfort with terminal :)

On the same website you can also get Address Book Server which uses a relational database instead and synchronised in both directions.

The web site is : http://www.addressbookserver.com

Have fun
Alex
 
Back
Top