I am working on a script that verifies a computer is connection correctly to both our AD domain and our OpenDirectory server. I bind to the two services using dsconfigad and dsconfigldap and then set the search path using the following commands:
/usr/bin/dscl /Search -create / SearchPolicy CSPSearchPath
/usr/bin/dscl /Search -append / CSPSearchPath "/Active Directory/All Domains"
/usr/bin/dscl /Search/Contacts -create / SearchPolicy CSPSearchPath
/usr/bin/dscl /Search/Contacts -append / CSPSearchPath "/Active Directory/All Domains"
/usr/bin/dscl /Search -append / CSPSearchPath "/LDAPv3/opendirectoryserver.local"
/usr/bin/dscl /Search/Contacts -append / CSPSearchPath "/LDAPv3/opendirectoryserver.local"
It's easy to verify and unbind the computer from the domains but how to I list the SearchPath to check if I need to reset it?
You can use:
to list the items in the SearchPath.
you can also use
you don't need to add anything after the "=" to see details for the current user/group/computer