AFP548 Changing the world one server at a time.

Script to automatically bind and unbind from OD-Server

Home › Forums › OS X Server and Client Discussion › Open Directory › Script to automatically bind and unbind from OD-Server

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #380647
    Huhu
    Participant

    Hey there!

    I have the following problem: When i freshly bind machines to my OD-server, the logon process with serverprofiles is very quick, but when I shutdown the machine and start it again, the logon process is very slow (about 5 minutes till I see my wallpaper…).

    To solve the symptoms of ths problem I have to unbind and rebind the machine, then everything is fine untill I shutdown the machine.

    The Server is a XServe with OS X Server 10.6
    The clients are different iMac models and MacBooks, all of them are connected by GigabitLAN (so that shouldn’t cause the problems).

    Since I’ve tried everything to solve the problem and I don’t wan’t to invest more time in this, I’m looking now for a script, which binds the machine to the OD-Server BEFORE the logon window appears and unbinds the client from the server when the machine is shutted down.

    I vaguely remember that I’ve heard sometimes about a script like this, but I can’t remember where that was.

    I hope you can help me

    Oh and by the way: I’m a noob in scripting… 🙂

    Bye

    Marius

    #380653
    Huhu
    Participant

    Hi

    I’ve now found a script from which I think that it could solve my problem:

    http://hintsforums.macworld.com/showthread.php?t=92421 (scroll down)

    And on this Page it’s described how I can create a startup item:

    http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Articles/StartupItems.html

    I’ve customized the script for my needs (since I only need an automatic binding to the OD-Server I can wipe out all the AD-related stuff I think?!)

    The Name of the OD-Server is: hoempf and it can be found locally under hoempf.local

    #!/bin/sh

    computerid=’/usr/sbin/scutil –get LocalHostName’

    # Bind to LDAP
    dsconfigldap -u {diradmin} -p {4321qay.} -f -a {hoempf} -c $HOSTNAME -n {heompf}
    # dsconfigldap -v -s -f -a {hoempf} -n {hoempf} -u {diradmin} -p {4321qay.}-l {admin} -q {1234}

    #defaults write /Library/Preferences/DirectoryService/SearchNodeConfig “Search Node Custom Path Array” -array “/LDAPv3/odservername”
    #defaults write /Library/Preferences/DirectoryService/SearchNodeConfig “Search Policy” -int 3

    #plutil -convert xml1 /Library/Preferences/DirectoryService/SearchNodeConfig.plist

    sudo killall DirectoryService

    # LDAP in search path
    #sudo dscl /Search -append / CSPSearchPath /LDAPv3/ODservername

    Could you please check this script and say if it can work like this? Again: I have no idea about scripting, so I would really appreciate any help I can get!

    Greez

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