Forum: JRuby LDAP Search function

6255b889d53f114e9a012375f9becd53?d=identicon&s=25 Sathya Prakash (Guest)
on 2014-02-06 12:37
(Received via mailing list)
Hi ,

Can any one kind let me know the syntax of the search method/function
ins
LDAP using RUBY

I am facing issue when i use the below script, I Guess there will be
issue
in filter. I am try to search and employee email id in my company.


filter = '(objectclass=VENKATA EEDARA)'

      attrs = ["name","samAccountName", "cn", "mail", "department",
"manager"]


ldap_conn.bind(ldap_base_dn, 'My Password')  do |conn|
     conn.search(ldap_base1_dn, LDAP::LDAP_SCOPE_SUBTREE, filter,attrs)
do
|entry|
        puts "#{entry.inspect}"
 end
  end
  rescue  Exception => e
    puts 'I am rescued.'
puts e.backtrace
    puts e.backtrace.inspect
  end

end
This topic is locked and can not be replied to.