[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

LDAP search and return

Stuart Brand

7/10/2006 2:51:00 PM

Hi all

I am trying to connect to our LDAP server(Active Directory :( )

I can do a successful bind, the problem I have is getting the data :(

I think the conn.search is correct

result = conn.search( 'ou=accounts, dc=example, dc=com',
LDAP::LDAP_SCOPE_SUBTREE, 'samaccountname=myuser')

it doesn't error for the above, how do I extract the information from
the search?

Many thanks all

Stuart

--
Posted via http://www.ruby-....

2 Answers

Stuart Brand

7/10/2006 3:04:00 PM

0

Francis Cianfrocca wrote:
> Which library are you using? Net::LDAP or one of the native ones?

I'm using ruby ldap, as in http://ruby-ldap.source...

LDAP::Conn.new

--
Posted via http://www.ruby-....

Stuart Brand

7/10/2006 3:39:00 PM

0

Not to worry, I found a script that does what I want it to do anyway :)

conn.search( 'ou=users,ou=nyc,dc=corp,dc=google,dc=com',
LDAP::LDAP_SCOPE_SUBTREE, 'cn=*', ['cn']) do |x|
count += 1
end

Thanks anyway

Stuart

--
Posted via http://www.ruby-....