Shell Script to remove a client's bindings to an old server and then bind them to a new Directory server.
Submitted by tlarkin on Fri, 08/15/2008 - 21:56
This is a script that will remove the current binding of the client machine and then rebind it to whatever Directory Server you specify. It works in 10.4.11 and 10.5.
#!/bin/sh #This script binds a 10.4.11 or 10.5 client to an LDAP (OD) server.oldserver="old.domain.com"newserver="new.domain.com"/usr/sbin/dsconfigldap -r $oldserver/usr/bin/dscl localhost -delete /Search CSPSearchPath /LDAPv3/$oldserver/usr/bin/dscl localhost -delete /Contact CSPSearchPath /LDAPv3/$oldserversleep 10 #give it time to clear before proceeding/usr/sbin/dsconfigldap -a $newserver/usr/bin/dscl localhost -create /Search SearchPolicy dsAttrTypeStandard:CSPSearchPath/usr/bin/dscl localhost -merge /Search CSPSearchPath /LDAPv3/$newserver/usr/bin/dscl localhost -create /Contact SearchPolicy dsAttrTypeStandard:CSPSearchPath/usr/bin/dscl localhost -merge /Contact CSPSearchPath /LDAPv3/$newserver
- Login to post comments
