Skip to content

Instantly share code, notes, and snippets.

@joecannatti
Created March 31, 2011 18:03
Show Gist options
  • Save joecannatti/896888 to your computer and use it in GitHub Desktop.
Save joecannatti/896888 to your computer and use it in GitHub Desktop.
require 'pp'.
require 'ldap'.
include LDAP
begin
connection = Conn.new('10.86.115.136', 389).
connection.set_option(LDAP_OPT_PROTOCOL_VERSION, 2).
connection.bind do
puts "in bind"
base_dn = 'dc=prnewswire,dc=com'
scope = LDAP_SCOPE_ONELEVEL.
filter = '*'.
connection.search(base_dn, scope, filter) do |entry|
puts "in res"
pp entry.to_hash
end.
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment