AFP548 Changing the world one server at a time.

Adding AD entries to the Auth and Contacts via script?

Home › Forums › OS X Server and Client Discussion › Active Directory › Adding AD entries to the Auth and Contacts via script?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #363163
    John M
    Participant

    Is it possible via a shell script to add an AD entry to the Authentication and Contacts tabs of Directory Access?

    I can script the machine’s addition to the AD domain just fine, but then I have to go in to Directory Access manually and add the Auth and Contacts entries, which well … sort of defeats the point of using scripts.

    In Panther, I could bind and unbing an image machine and the entries would remain, but Tiger seems to clean itself up better.

    Any ideas?

    Thanks!

    #363169
    fherbert
    Participant

    You can use the ‘defaults’ command as one way around this..

    For the search path:

    defaults write /Library/Preferences/DirectoryService/SearchNodeConfig "Search Node Custom Path Array" '("/Active Directory/All Domains")'
    
    

    And for the contacts path:

    defaults write /Library/Preferences/DirectoryService/ContactsNodeConfig "Search Node Custom Path Array" '("/Active Directory/All Domains")'
    
    

    These settings will be available in Directory access after a restart. Take note that they will be accepted, even if that directory node is not configured/existing.

    NOTE: This will remove any existing custom contact and search node path you have..

    Let me know how you get on.

    Cheers

    #363185
    fherbert
    Participant

    Yes, I’ve just read the new AD-OD paper with the section on using dscl for setting up the search path. I did check the man page for dscl but didn’t see any examples or stand out way to modify the search path…. I guess using dscl would be the better way??

    #363502
    Anonymous
    Guest

    My question is how do you turn on AD using DSCl. I found the command to add the Authentication path. Just need to turn it on in 103 and 10.4

    #363516
    superrcat
    Participant

    Tim Kendall wrote:

    My question is how do you turn on AD using DSCl. I found the command to add the Authentication path. Just need to turn it on in 103 and 10.4

    Eh. You could use defaults as in the previous post, but it has the same limitations since DirectoryService is already running…

    defaults write /Library/Preferences/DirectoryService/DirectoryService "Active Directory" 'Active'
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.