# Ruby-Net-Lap - Problems to Search

**URL:** <https://www.ruby-forum.com/t/ruby-net-lap-problems-to-search/131828>\
**Category:** Ruby\
**Created:** [March 13, 2008, 5:21pm UTC](https://www.ruby-forum.com/t/ruby-net-lap-problems-to-search/131828 "2008-03-13T17:21:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![edmz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/898d66/32.png) [@edmz](https://www.ruby-forum.com/u/edmz)\
**Post date:** [March 13, 2008, 5:21pm UTC](https://www.ruby-forum.com/t/ruby-net-lap-problems-to-search/131828/1 "2008-03-13T17:21:48Z")

</div>

I’m using the ruby-net-ldap to connect in the Active Directory. I’m able  
to connect but for some strange reason when i try to do any search  
nothing is returned.

Follow the code:

```
 username = 'user'
 password = 'password'
 ldap = Net::LDAP.new(:host => 'host', :port => 389, :base =>

```

‘dc=domainname,dc=domain’)  
ldap.auth(username, password)

```
 if ldap.bind

puts "# authentication succeeded"

filter = Net::LDAP::Filter.eq('name', "steven*")
ldap.search(:base => "dc=domainname,dc=domain", :filter => filter)

```

{|entry|  
puts “found”  
}

```
 else
puts "# authentication failed"
 end

```

The console show “# authentication succeeded” but “found” never is  
printed

Someone already had some problem like this?
