AFP548 Changing the world one server at a time.

Scripting OD binding

Home › Forums › OS X Server and Client Discussion › Open Directory › Scripting OD binding

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #369854
    icondaemon
    Participant

    OD Wizards-

    I’m working on finishing up a master image to push to my school’s 10.4.10 Macs with NetInstall. I’m using WGM to manage the Macs.

    I have the LDAP server info correctly configured in Directory Access, and the Authentication search path set correctly. (We use ADmitMac for AD access and need AD first in search path, OD second.)

    When the machine is bound to the OD, WGM works as advertised.

    I would like to leave the master image unbound and script the binding of the target machine after it has been NetImaged.

    Dsconfigldap only works to create a LDAP server connection and then bind the machine. It will not just do the bind if the server connection has already been made.

    How do I script a bind?

    Thanks!

    +- IconDaemon -+

    #369855
    icondaemon
    Participant

    A bit of sweat and a visit to Macenterprise.org (thanks, Lance Ogletree!) and I’ve figured it out.

    Here’s the perl code to create the server entry in Directory Access and create the entry in the Search Path window:

    $host_name =`scutil --get ComputerName`;
    
    chomp $host_name;
    
    `dsconfigldap -f -a OD_SERVER -n OD_GUI_NAME -c $host_name -u diradmin -p '<password>' -l root -q '<password>'`;
    
    sleep 10;
    
    `dscl /Search -append / CSPSearchPath /LDAPv3/OD_SERVER`;

    ~

    OD_SERVER is the OpenDirectory server FQDN.
    OD_GUI_NAME is a string for human use only.

    The sleep quantum is necessary to allow Directory Services to make the LDAP server entry. 10 seconds may be a bit too long in the scheme of things, but hey, it saves me from touching each machine to do a manual config!

    +- IconDaemon -+

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