Home › Forums › OS X Server and Client Discussion › Active Directory › Binding into WM container
- This topic has 4 replies, 2 voices, and was last updated 12 years, 10 months ago by
Goldberg.
-
AuthorPosts
-
June 6, 2012 at 11:00 pm #382325
Twerpin
ParticipantHi,
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”
fiJune 13, 2012 at 7:50 am #382433Goldberg
ParticipantWe 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 12 years, 10 months ago by
Goldberg.
June 15, 2012 at 7:23 pm #382461Twerpin
ParticipantInteresting. 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.
June 15, 2012 at 9:31 pm #382462Twerpin
ParticipantI 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?
June 18, 2012 at 7:37 am #382477Goldberg
ParticipantI’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 12 years, 10 months ago by
Goldberg.
-
This reply was modified 12 years, 10 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed