I have had an issue recently where some of my student laptops are not binding to our Open Directory Server. I can cure this by Unbinding and Rebinding. Through trial and error, it seems that the issue is related to the Keychain Entry for the LDAP somehow getting corrupted or removed. In the meantime, since I was unable to find any clear answer to the Why, I am trying to write a script that will at least fix the issue, so kids can log-in.
My script is simply:
sudo dsconfigldap -r generic11.generic.org
sudo dsconfigldap -a generic11.generic.org
But the most important part is likely the prompt(see pic below) Is there away to script that to answer Y?
Any help or suggestions are greatly appreciated.