我正在尝试使用 ruby 的 net-ldap 库查询 ldap 服务器以获取任何组的详细信息
require 'rubygems'
require 'net/ldap'
username = "user1"
password = "pass1"
host = 'server.address'
ldap = Net::LDAP.new :host => host, :port => 389
ldap.auth username, password
filter = Net::LDAP::Filter.eq("cn", "*group*")
ldap.search(:base => treebase, :filter => filter, :return_result => true) do |entry|
puts "DN: #{entry.dn}"
entry.each do |attr, values|
puts ".......#{attr}:"
values.each do |value|
puts " #{value}"
end
end
end
我获得了有关该组的详细信息,但没有获得该组的所有者。
知道什么是错的吗?以及如何做