Hello everyone
I'm using net-ldap 6.1 and rials 4.1.2.
I'm trying to list the usernames of a security group, with no success at all :-(
The filter is combing properly, and I can run this code successfully from a windows machine. Same access details
CSVDE -R "(&(objectCategory=user)(memberOf=CN=Interact Users,OU=Interact,DC=uni,DC=glam,DC=ac,DC=uk))" -L sAMAccountName -F c:\code\temp\usersingroup.txt
Here's my ruby code
l = Net::LDAP.new
l.host = 'DC'
l.port = 389
l.auth 'username','password'
l.bind
f = Net::LDAP::Filter.eq( "objectCategory", "user")
g = Net::LDAP::Filter.eq("memberOf", "CN=Interact Users,OU=Interact,DC=uni,DC=glam,DC=ac,DC=uk")
h = Net::LDAP::Filter.join(f, g)
i =
puts h
t=""
puts l.get_operation_result.code
puts l.get_operation_result.message
attrs = ["samaccountname", "initials"]
l.search(:filter=>h,:base=>t, :attributes => attrs) do |entry|
puts entry.sAMAccountName
Whatever I do, and I've tried using different security groups, without spaces, and changed lots of things, I keep getting no results back. It connects successfully.
If I put a load of garbage into the filters, I still get 0 back.
Does anyone have any ideas why this isn't working?
I wouldn't be surprised if I'm doing something incredibly stupid, please point it out to me though, I will take no offence.
Matt