Koozali.org: home of the SME Server

e-smith ldapsearch

jane

e-smith ldapsearch
« on: June 18, 2003, 08:25:16 AM »
Hi everybuddy!

I have created a few groups and every user account has been assigned to certain group.

I have a lack of knowledge on how to use the ldapsearch. I was wondering can I use ldapsearch to search each group is belong to which user account.

Any answer, reference ,suggestion, etc. are very very much appreciated!

Paul Miller

Re: e-smith ldapsearch
« Reply #1 on: June 29, 2003, 05:56:12 AM »
jane wrote:
>
> Hi everybuddy!
>
> I have created a few groups and every user account has been
> assigned to certain group.
>
> I have a lack of knowledge on how to use the ldapsearch. I
> was wondering can I use ldapsearch to search each group is
> belong to which user account.

 I don't know how to get exactly what you want with filters.  I am just learning ldapsearch too and tried quite a few combinations with no success.  There a number of ways to combine parameters so I hope one can make a multiple filter to associate all users with all groups.  The filter should conform to the string  representation for LDAP filters as defined in RFC 1558.

 http://www.faqs.org/rfcs/rfc1558.html

The following gets all users along with all groups when run on e-smith.  I suppose if one can't write a filter, a script could sort out the associations.

ldapsearch '(objectClass=*)'

> Any answer, reference ,suggestion, etc. are very very much
> appreciated!

 I looked at these websites for examples.

Populating OpenLDAP Databases
http://sapiens.wustl.edu/~sysmain/info/openldap/openldap_populate.html

Using Multiple Search Filters
http://developer.netscape.com/docs/manuals/directory/admin30/find.htm

Hope this is of some value.

Paul Miller

Re: e-smith ldapsearch
« Reply #2 on: June 30, 2003, 09:57:36 PM »
Paul Miller wrote:
>
> jane wrote:
> >
> > Hi everybuddy!
> >
> > I have created a few groups and every user account has been
> > assigned to certain group.
> >
> > I have a lack of knowledge on how to use the ldapsearch. I
> > was wondering can I use ldapsearch to search each group is
> > belong to which user account.
>
>  I don't know how to get exactly what you want with filters.
> I am just learning ldapsearch too and tried quite a few
> combinations with no success.  There a number of ways to
> combine parameters so I hope one can make a multiple filter
> to associate all users with all groups.  The filter should
> conform to the string  representation for LDAP filters as
> defined in RFC 1558.
>
>  http://www.faqs.org/rfcs/rfc1558.html
>
> The following gets all users along with all groups when run
> on e-smith.  I suppose if one can't write a filter, a script
> could sort out the associations.
>
> ldapsearch '(objectClass=*)'
I found more tidbits that might help.

ldapsearch "(objectClass=group*)" uid
ldapsearch "(objectClass=person*)" uid

Each of the above searches provide a different list but gid and uid are apparently the same.

Hope someone else can figure out how to associate users and groups in one step.
Paul