[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: ruby scripting on microsoft active directory plus exchange

Ball, Donald A Jr (Library)

4/19/2007 5:21:00 PM

> There is an attribute called memberof which has a list of all
> the groups the user account belongs to. You should be able
> to call memberof on your returned LDAP object and get an
> array with the groups in it.

That works great, thanks! A quick followup if you don't mind: if I'm
trying to authenticate a user and see if she belongs to either of two
groups, say, is it better to search twice against two different
treebases and simply see if either returns a match, or search in the
nearest common ancestor and check the memberof attribute?

- donald

1 Answer

Clifford Heath

4/19/2007 11:29:00 PM

0

Ball, Donald A Jr (Library) wrote:
>> There is an attribute called memberof which has a list of all
>> the groups the user account belongs to. You should be able
>> to call memberof on your returned LDAP object and get an
>> array with the groups in it.
>
> That works great, thanks! A quick followup if you don't mind: if I'm
> trying to authenticate a user and see if she belongs to either of two
> groups, say, is it better to search twice against two different
> treebases and simply see if either returns a match, or search in the
> nearest common ancestor and check the memberof attribute?

Beware that if you encounter a group that has more than 1000 members,
Microsoft AD has a custom extension to the standard LDAP protocol to
handle paging. Basically you get an attribute returned that has an
extended name, and not all values. IIRC the extension is ";min-max"
where min and max are the index numbers of the first and last value
returned from the members array. You need then to repeat the query,
asking for a similarly-named attribute with larger min and max
numbers, until a query returns fewer than you asked for.

Clifford Heath.