Articles‎ > ‎

Send Unix command script for AD & OD binding

posted Dec 23, 2008, 9:59 AM by Philip Rinehart   [ updated Dec 23, 2008, 10:00 AM by Greg Neagle ]
E-mail
Written by Lance Ogletree   
Tuesday, 05 September 2006
Here's an example script that I use for binding our macs to both AD and OD via the send unix command in Apple Remote Desktop. This is tested for 10.4.x clients

computerid=`scutil --get ComputerName`

dsconfigldap -v -f -a OD_SERVER -n OD_SERVER -c $computerid -u ADMIN_USERNAME -p 'ADMIN_PASSWORD'
sleep 10
dsconfigad -f -a $computerid -domain AD_DOMAIN -u OU_ADMIN -p 'OU_ADMIN_PASSWORD' - ou "CN=Computers,OU=Engineering,DC=ads,DC=demo,DC=com"
sleep 20

dscl /Search -create / SearchPolicy CSPSearchPath
dscl /Search -append / CSPSearchPath /LDAPv3/OD_SERVER
dscl /Search -append / CSPSearchPath "/Active Directory/All Domains"

sleep 10
dscl /Search/Contacts -create / SearchPolicy CSPSearchPath
dscl /Search/Contacts -append / CSPSearchPath /LDAPv3/OD_SERVER
dscl /Search/Contacts -append / CSPSearchPath "/Active Directory/All Domains"

# You will notice that in our environment, we have listed our OD server first, then AD. Depending upon your 
# environment, you may need to reverse the order. 

Comments