Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

You can use:

/usr/bin/dscl /Search -read / 

to list the items in the SearchPath.

share|improve this answer

you can also use

mcxquery -user = -group = -computer =

you don't need to add anything after the "=" to see details for the current user/group/computer

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.