Skip to content

@johnivanoff /gist:3179885
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
require 'sinatra'
require 'net/ldap'
ldap = Net::LDAP.new
ldap.host = '192.168.1.1'
ldap.port = 389
ldap.auth "username", "password"
filter = Net::LDAP::Filter.eq('CN', '*')
treebase = "dc=reputablecompany, dc=com"
ldap.search(:base => treebase, :filter => filter) do |entry|
puts "CN: #{entry.cn}"
puts "Department: #{entry.company}"
end
p ldap.get_operation_result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.