Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
require 'sinatra'
require 'net/ldap'
ldap = = ''
ldap.port = 389
ldap.auth "username", "password"
filter = Net::LDAP::Filter.eq('CN', '*')
treebase = "dc=reputablecompany, dc=com" => treebase, :filter => filter) do |entry|
puts "CN: #{}"
puts "Department: #{}"
p ldap.get_operation_result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment