Net::LDAP e active directory

base = “ou=Ruby U.,dc=rubyforum,dc=local” # dipende dalla
configurazione
del tuo server ldap

login_filter = Net::LDAP::Filter.eq(“sAMAccountName”,
“ciccio.pasticcio”) #
creo il filtro sull’attributo ‘sAMAccountName’

attrs = [“mail”, “memberOf”] # gli attributi che voglio recuperare

ldap_client.search(:base => base, :filter => login_filter, :attributes
=>
attrs, :size => 1, :return_result => false) do |entry|
puts “entry: #{entry.inspect}”
end

sulla documentazione trovi altri esempi.

good luck!!

bio

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs