AFP548 Changing the world one server at a time.

Searching Active Directory

Home › Forums › OS X Server and Client Discussion › Active Directory › Searching Active Directory

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #364894
    Kerry
    Participant

    I’m looking for a way to “search” our active directory domain. I’ve looked at using dscl but haven’t found a way to do quite what I want.

    Basically on our intranet we have a phone search. At the moment it searches a MySQL database that is separately maintained. I would like to find a way to make it so I can search the domain and return the phone number based on a last name, all the users listed at a specific site, etc.

    Address Book seems to have this functionality but I haven’t found a way to script the search that includes the AD…

    Any suggestions or ideas?

    #364898
    Kerry
    Participant

    Address Book does show results (including the phone number) if I search the Directory. However, what I would like to do is write a script (ideally perl) that does the same thing in the background for a website.

    I may have finally stumble on my own answer today. I think if I ran multiple searches (FirstName, LastName, Location, etc.), take the results and then read the PhoneNumber for each user I could put it all together. Ideally there is a better way or if I was really lucky someone has already tried to do this and has some code that would save me some time.

    Example of what I’m thinking right now…
    -search /Contact/Users LastName “SomeName”

    then for each of the results (after ruling out duplicates)
    -read /Contact/Users/SomeName PhoneNumber

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.