auth bind script

tlarkin
Honored Contributor

So I have a group of iMacs that we want in the OD and we want managed via MCX but we want to disable all log ins but local accounts and to do so I need to do an authenticated bind. So, I wrote this script and the commands them self seem to work individually but when i try to put it all together I get all kinds of weird errors...

On OS X 10.5.8.....and here is my script

#!/bin/bash

# set this script to bind sumner iMac desktops

# set the FQDN of server for client to bind

server="myserver.com"

# start script

/bin/echo "Starting script.."

# bind to ODR Sumner

/usr/sbin/dsconfigldap -f -v -e -a $server -u myadmin -p mypasswd -c `/usr/sbin/networksetup -getcomputername` -q localadmin -l localpw

/bin/sleep 40 #give it time to authenticated bind before proceeding

/usr/bin/dscl localhost -create /Search SearchPolicy dsAttrTypeStandard:CSPSearchPath

/usr/bin/dscl localhost -merge /Search CSPSearchPath /LDAPv3/$server

/usr/bin/dscl localhost -create /Contact SearchPolicy dsAttrTypeStandard:CSPSearchPath

/usr/bin/dscl localhost -merge /Contact CSPSearchPath /LDAPv3/$server

/bin/echo "completed process of autehnticated bind.."

/bin/echo "now purging all logs to clean up what we just did..."

/bin/rm -rf /var/logs/*

/bin/echo "logs purged now exiting..."

exit 0

Thoughts?

1 REPLY 1

Bukira
Contributor

Can't u just use the Casper OD bind on the jss and then add them to a computer group ( scoped to your macs) that has those settings applied in the OD?

That's that I do

I have different od computer groups with different settings then I bind all macs to the OD after imaging reboot and then based on their scope I auto add them to a particular OD group

Criss