Binding into WM container
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