<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:14pt"><div>Thanks Andy<br><br>I wish I was even this far along (to do queries). I can't even import a basic ldif to populate my LDAP, without running into errors. <br><br>Here's an example:<br><br>bmsadmin@LDAP:/root$ sudo slapadd -l init.ldif<br>/etc/ldap/slapd.conf: line 114: rootdn is always granted unlimited privileges.<br>/etc/ldap/slapd.conf: line 131: rootdn is always granted unlimited privileges.<br>Entry (dc=bms,dc=bc,dc=ca): object class 'organizationalUnit' requires attribute 'ou'<br>slapadd: dn="dc=bms,dc=bc,dc=ca" (line=1): (65) object class 'organizationalUnit' requires attribute
 'ou'<br>                                                                                              (* NOTE: this is corrected now - Ken^^^^^^^^^^^^^)<br><br>bmsadmin@LDAP:/root$ sudo rm -rf /var/lib/ldap/*<br><br>bmsadmin@LDAP:/root$ sudo slapadd -l init.ldif<br>/etc/ldap/slapd.conf: line 114: rootdn is always granted unlimited privileges.<br>/etc/ldap/slapd.conf: line 131: rootdn is always granted unlimited privileges.<br>str2entry: invalid value for attributeType objectClass #1 (syntax
 1.3.6.1.4.1.1466.115.121.1.38)<br>slapadd: could not parse entry (line=7)<br> <br>So I opened the source file (ldif):<br><br>1:    dn:     dc=bms,dc=bc,dc=ca<br>2:    objectClass:    dcObject<br>3:    objectClass:    organizationalUnit<br>4:    dc:     bms<br>5:    ou:     Bamfield Marine Science Centre<br>6:<br>7:    dn:     cn=admin,dc=bms,dc=bc,dc=ca *****nothing wrong with this line AFAICT<br>8:    objectClass:    simpleSecurityObject<br>9:    objectClass:    oganizationalRole<br>10:    cn:     admin<br>11:    description:    LDAP Administrator<br>12:    userPassword:  
 {SSHA}eyYgSORDGFd2CELlAy1fD3JAY+cc/TmR<br>13:<br>14:    dn:     ou=people,dc=bms,dc=bc,dc=ca<br>15:    objectClass:    organizationalUnit<br>16:    ou:     people<br>17:<br>18:    dn:     ou=groups,dc=bms,dc=bc,dc=ca<br>19:    objectClass:    organizationalUnit<br>20:    ou:     groups<br>21:<br>22:dn:     uid=lionel,ou=people,dc=bms,dc=bc,dc=ca<br>-------SNIP---------------------<br><br>Other than the domain name, this is an exact copy of:<br>https://help.ubuntu.com/community/OpenLDAPServer<br><br>Ken<br><br><br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 14pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font size="2" face="Tahoma"><hr size="1"><b><span
 style="font-weight: bold;">From:</span></b> Andy Boersma <andy@boersma.ca><br><b><span style="font-weight: bold;">To:</span></b> The Canadian Ubuntu Users Community <ubuntu-ca@lists.ubuntu.com><br><b><span style="font-weight: bold;">Sent:</span></b> Friday, March 6, 2009 1:23:46 PM<br><b><span style="font-weight: bold;">Subject:</span></b> RE: begging for help<br></font><br>


 
 

 

<style>
<!--
 
 _filtered {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
 
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;text-decoration:underline;}
span.EmailStyle17
        {font-family:Arial;color:navy;}
 _filtered {margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {}
-->
</style>



<div class="Section1">

<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">Hi Ken,</span></font></p> 

<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">You are totally correct, documentation
sucks huge buckets in LDAP.</span></font></p> 

<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">I had to spend some time figuring it out,
from bad examples.</span></font></p> 

<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">Here are working queries, to query active
directories.</span></font></p> 

<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">  </span></font></p> 

<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">Hope this helps you.</span></font></p> 

<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">  </span></font></p> 

<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">Andy</span></font><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"></span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">1<sup>st</sup> Query</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">select sAMAccountName name from ou=ProdUsers, ou=users, ou=city, 
ou=am, ou=pkg, ou=Prod where objectCategory=user</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">This query gives me a list of users.</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">2<sup>nd</sup> Query</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">select sAMAccountName name from ou=ProdUsers, ou=users, ou=city,
ou=am, ou=pkg, ou=Prod where objectCategory=user and sAMAccountName=?</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Using logon-name xmii1admin, lists admin.</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">3<sup>rd</sup> Query</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">select name from ou=Groups, ou=xMII-SAP-SFDC,  ou=am,
ou=pkg, ou=Prod </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">This query lists the groups. </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">4<sup>th</sup> Query</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">select name from ou=Groups, ou=xMII-SAP-SFDC,  ou=am,
ou=pkg, ou=Prod  where name=?</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Given the group xMII_Admin, it finds the group xMII_Admin
and lists it.</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">5<sup>th</sup> Query</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">select cn FullName, mail EmailAddress1 from ou=ProdUsers,
ou=users, ou=city,  ou=am, ou=pkg, ou=Prod where sAMAccountName=?</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Give the user xMII1Admin, it displays the emailaddress and
full name of user.</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">6<sup>th</sup> Query</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">select cn FullName, mail EmailAddress1 from ou=Groups,
ou=xMII-SAP-SFDC,  ou=am, ou=pkg, ou=Prod where sAMAccountName=?</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Give the role/group xMII_Admin it returns the role name, we
do not have a e-mail address as part of a group</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">7<sup>th</sup> Query</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">select distinguishedName from ou=ProdUsers, ou=users, ou=city,
ou=am, ou=pkg, ou=Prod  where objectCategory=user and sAMAccountName=?</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Given the user name xMII1Admin, I get the full DN</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">8<sup>th</sup> Query</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">select name from ou=ProdUser, ou=users, ou=City, ou=am,
ou=pkg, ou=Prod where objectCategory=group and member=?</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">9<sup>th</sup> Query</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">select distinguishedName from ou=ProdUsers, ou=users, ou=city,
ou=am, ou=pkg, ou=Prod where objectCategory=group and name=?</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">10<sup>th</sup> Query</span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">select sAMAccountName name from ou=ProdUsers, ou=users, ou=city,
ou=am, ou=pkg, ou=Prod where objectCategory=user and memberOf? </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">  </span></font></p> 

<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">  </span></font></p> 

<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">  </span></font></p> 

<div>

<div class="MsoNormal" style="text-align: center;" align="center"><font size="3" face="Times New Roman"><span style="font-size: 12pt;" lang="EN-US">

<hr tabindex="-1" align="center" size="2" width="100%">

</span></font></div>

<p class="MsoNormal"><b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;" lang="EN-US">From:</span></font></b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma;" lang="EN-US">
ubuntu-ca-bounces@lists.ubuntu.com [mailto:ubuntu-ca-bounces@lists.ubuntu.com] <b><span style="font-weight: bold;">On Behalf Of </span></b>Kenneth Hawkins<br>
<b><span style="font-weight: bold;">Sent:</span></b> March-06-09 3:55 PM<br>
<b><span style="font-weight: bold;">To:</span></b> The
 Canadian Ubuntu Users Community<br>
<b><span style="font-weight: bold;">Subject:</span></b> begging for help</span></font><span lang="EN-US"></span></p> 

</div>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;">  </span></font></p> 

<div>

<div>

<p class="MsoNormal" style="margin-bottom: 14pt;"><font size="4" face="Arial"><span style="font-size: 14pt; font-family: Arial;">Howdy all<br>
<br>
Anyone here proficient in LDAP? I have been following a tutorial from
help.ubuntu.com, but it is wrong somewhere in the syntax, and I cannot find the
error. When I contacted the person whose name was attached to the article, he
said that all he had done was some minor edit; apparently  the last
contributor gets listed as author. <br>
<br>
I have done many long jobs in linux over the years (net install debian &
built web servers from source, VM's back when QEMU was the only game, etc) but
I have never experienced such a lack of (useful) resources for something which
is supposed to be the killer app for enterprise user management.....I am really
getting sick & tired of LDAP how-to's/tutorials that NEVER work as
described. I have tried at least 6 different versions over the last few months,
and NOT A SINGLE ONE works as the author claims. In a couple of cases, when I
contacted them directly, I was basically told RTFM or man slapd.....is there
some level of arrogance that comes with LDAP proficiency?<br>
<br>
I have a very basic ubuntu 8.04 LTS server, with up-to-date openldap from
repos. The sole purpose of this server is going to be Centralized login, and
addressbook. <br>
<br>
Thanks in advance for any pointers, or even a link to an LDAP howto that
actually works......<br>
<br>
<br>
Ken<br>
<br>
<br>
</span></font></p> 

</div>

</div>

</div>

</div></div></div></body></html>