Adding AD to search paths via dscl
After using the usual dsconfigad script to bind our machines, the machine will bind, but the dscl command that's used to add the paths to /Search and /Search/Contacts doesn't seem to work:
[code]
~ root# dscl /Search -read / CSPSearchPath
CSPSearchPath: /Local/Default /BSD/local /LDAPv3/[OD server]
~ root# dscl /Search/Contacts -read / CSPSearchPath
CSPSearchPath: /Local/Default /BSD/local /LDAPv3/[OD server]
~ root# dscl /Search -append / CSPSearchPath "/Active Directory/All Domains"
attribute status: eDSNodeNotFound
DS Error: -14008 (eDSNodeNotFound)
~ root# dscl /Search/Contacts -append / CSPSearchPath "/Active Directory/All Domains"
attribute status: eDSNodeNotFound
DS Error: -14008 (eDSNodeNotFound)
[/code]
However, if I log in to the machine and simply open up Directory Utility, I see a red light on the ads server, but, if I return to the command line without doing anything in the GUI:
[code]
~ root# dscl /Search -append / CSPSearchPath "/Active Directory/All Domains"
~ root# dscl /Search/Contacts -append / CSPSearchPath "/Active Directory/All Domains"
~ root# dscl /Search -read / CSPSearchPath
CSPSearchPath:
/Local/Default
/BSD/local
/LDAPv3/[OD server]
/Active Directory/All Domains
[/code]
So apparently, running the Directory Utility GUI does something that enables one to add the ads paths via the command line. The thing I want to know is, what is that? And can it be duplicated via the command line so I can script the whole thing. The error still happens if I don't bind to the OD server at all, and start with a clean image and no directory bindings at all. The reason I'm binding the OD first is that the computer gets its name from the OD, and then uses it to bind to AD. I have thought about using a single AD computer account, but don't want to invite disaster if it gets deleted, and all of our Macs can't authenticate anymore.
Also, I'm creating the CSPSearchPath key when I bind to OD, so that step is already done. But, I still get the same error if I start with a clean, OD-less image. I can create the CSPSearchPath keys, but cannot append the ADS path to them.