Home Forums OS X Server and Client Discussion Active Directory Binding into WM container

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #382325
    Twerpin
    Participant

    Hi,

    I administer a small lab of iMac’s.  The AD server to which I bind is on a different subnet. Our network is part of a larger network.  I am putting together a method for imaging and maintaining the machines.  Because the machines are managed clients, they inherit all the preferences from the rules set on the WM container.  Currently, when I re-image the machines and rebind them, I have to manually drag them into the correct container in Workgroup Manager.  I am using dsconfigad to bind the machines, but I haven’t figured out a way to put them into the correct container.  Is there another tool I can use that can achieve this?  Here is the basic framework of what I would like to do in the imaging process, unbinding and binding to AD as well as imaging.. Some bash is included.

    -All computers are running on ‘Hard Drive’ partition
    -Backup ‘preferences.plist’
    -Unbind from AD domain & boot to ‘/Volumes/Tech’

    dsconfigad -remove -f -u [username] -p [password]
    bless -mount /Volumes/Tech -setBoot -nextonly
    shutdown -r now

    -Restore ‘Hard Drive’ & bless it

    asr restore –source asr://wherever.i.run.the.server –target ‘/Volumes/Hard Drive’ –erase –noprompt –noverify –puppetstrings
    -Retore preferences backed up.

    And for sourcing the image:

    asr -source [path to image] -server [path to configuration plist]

    Rebinding to AD:

    (parameters are set)

    # Bind to AD (but is there a way to bind to correct container?)
    dsconfigad -f -a $computerid -domain $domain -u $udn -p “$password” -ou “$ou”

    # Restart DirectoryService
    killall DirectoryService

    # Add the AD node to the search path
    if [ “$alldomains” = “enable” ]; then
    csp=”/Active Directory/All Domains”
    else
    csp=”/Active Directory/$domain”
    fi

    #382433
    Goldberg
    Participant

    We have this code in our bind script:

    # Add Mac to the standard mac prefs computerlist
    echo “Adding Mac the the standard mac prefs computerlist in WGM”

    computername=`/usr/sbin/scutil –get LocalHostName`

    /usr/bin/dscl -u $userid -p ‘/Active Directory/DOMAIN/All Domains’ -merge “/ComputerLists/standard mac prefs” apple-computers “$computername”

    The $userid is the account used to bind to AD.

    Hope that you,

    Goldberg

    • This reply was modified 11 years, 8 months ago by Goldberg.
    #382461
    Twerpin
    Participant

    Interesting.  Yes, it is a computer list that I’m trying to join.  I do have a question about your script since I’m not wholly familar with dscl.

     

    “/ComputerLists/standard mac prefs” apple-computers “$computername”

     

    So ‘standard mac prefs’ is the name of the ComputerList right?  Also, what is the ‘apple-computers’ part?

     

    Thank you so much. This looks like exactly what I needed.

    #382462
    Twerpin
    Participant

    I didn’t read thoroughly, my mistake about the computerlist name question. However, what does the “apple-computers” part relate to as part of the dscl syntax?

     

    #382477
    Goldberg
    Participant

    I’m not 100% sure about apple-computers part however do know 2 things:
    1. It doesn’t work without it.
    2. apple-computers is a objectClasses that is part of the Apple AD extended schema so it’s related to that.

    Goldberg
    @gmarnin

    • This reply was modified 11 years, 8 months ago by Goldberg.
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Comments are closed