[Casper] Configure LDAP via DHCP
Steve Wood
swood at integerdallas.com
Fri Jun 6 07:51:30 PDT 2008
In the Directory Utility application, when you open the LDAP service
you can tell LDAP to get its information from DHCP. I want to set
that from a shell script. Using defaults write was my first thought,
but the plist that controls that setting is not in the domain ("Domain
SearchNodeConfig.plist does not exist"). So, that means in order to
"trip" the flag you need to edit the plist by hand.
Now, the plist contains information in this format:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd
">
<plist version="1.0">
<dict>
<key>DHCP LDAP</key>
<dict>
<key>/Sets/5FB6FAF4-3397-4981-BCC0-4D8FE463CA1C</key>
<true/>
</dict>
<key>Search Node PlugIn Version</key>
<string>Search Node PlugIn Version 1.7</string>
<key>Search Policy</key>
<integer>1</integer>
</dict>
</plist>
Notice the key "DHCP LDAP". You need to set the value of the key to
true, as it is here (<true/>), if you want to gather the LDAP info
from DHCP. Since I cannot use defaults write to do this, that means I
have to use sed to parse out the key and then inject the true flag.
BTW, the key value (in this case <key>/Sets/5FB6FAF4-3397-4981-
BCC0-4D8FE463CA1C</key>) is different for each machine, so just
dropping the plist into each machine won't work (I tried).
Hope that helps.
Steve Wood
Director, Information Technology
swood at integerdallas.com
The Integer Group | 1999 Bryan St. | Ste. 1700 | Dallas, TX 75201
T 214.758.6813 | F 214.758.6907 | C 940.312.2475
On Jun 6, 2008, at 9:18 AM, Clinton Blackmore wrote:
> I'm afraid I'm not familiar with the change you want to make, but if
> you want to edit a plist, you want to use the "defaults" command.
> It will even edit binary plist files.
>
> If I misunderstood the question, though, it may be that you need to
> manipulate the data already within the plist (and are thinking of
> piping a defaults read into sed into defaults write), in which case,
> we are better able to help if we have details on the transformation
> you have in mind.
>
> Cheers,
> Clinton Blackmore
>
>
>
> On 5-Jun-08, at 9:50 AM, Steve Wood wrote:
>
>> Anyone have a script to trip the "Add DHCP Supplied LDAP"? The
>> only way I can see to do it is via a shell script using sed or
>> something else to edit the plist file.
>>
>> Steve Wood
>> Director, Information Technology
>> swood at integerdallas.com
>>
>> The Integer Group | 1999 Bryan St. | Ste. 1700 | Dallas, TX 75201
>> T 214.758.6813 | F 214.758.6907 | C 940.312.2475
>>
>>
>>
>>
>>
>>
>> --
>> The information contained in this email transmission is solely for
>> the addressee(s) named above and is privileged and/or
>> confidential. If the reader of this message is not the intended
>> recipient or the person responsible to deliver it to the intended
>> recipient; he or she is prohibited from reading or disclosing the
>> information contained in this transmission. Any examination, use,
>> dissemination, distribution, or copying of this communication is
>> strictly prohibited. Please contact us immediately by telephone
>> for instructions if you have received this communication in error:
>> (214) 758-6800
>> _______________________________________________
>> Casper mailing list
>> Casper at list.jamfsoftware.com
>> http://list.jamfsoftware.com/mailman/listinfo/casper
>
--
The information contained in this email transmission is solely for the addressee(s) named above and is privileged and/or confidential. If the reader of this message is not the intended recipient or the person responsible to deliver it to the intended recipient; he or she is prohibited from reading or disclosing the information contained in this transmission. Any examination, use, dissemination, distribution, or copying of this communication is strictly prohibited. Please contact us immediately by telephone for instructions if you have received this communication in error: (214) 758-6800
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.jamfsoftware.com/pipermail/casper/attachments/20080606/ec28fc47/attachment-0001.html
More information about the Casper
mailing list