David Pardy
2015-11-20 17:49:32 UTC
Hi, I've been getting fairly frustrated with this in trying to return some
data using ruby ldap. Ruby version is: ruby 2.2.1p85
The credentials are fine: I can connect without issues.
This will eventually be going into a Rails 4 application but just doing a
simple .rb file for now.
When I run 'ruby ldap.rb' I get
*#<OpenStruct code=32, error_message="0000208D: NameErr: DSID-03100238,
problem 2001 (NO_OBJECT), data 0, best match
of:\n\t'DC=enterprise,DC=my-company,DC=com'\n\u0000",
matched_dn="DC=enterprise,DC=my-company,DC=com", message="No Such Object">*
My IT admin set me a screenshot of what our AD attributes are. One of them,
to no surprise, is 'sAMAAccountName', so I'm just trying to do a simple
search on that.
*require 'net/ldap'*
*ldap = Net::LDAP.new :host => "123.456.789.12",*
* :port => 389,*
* :auth => { *
* :method => :simple,*
* :username => "***@my-company.com",*
* :password => "Password"*
* }*
*filter = Net::LDAP::Filter.eq("sAMAccountName", "*")*
*treebase = "dc=Users - Employees,dc=enterprise,dc=my-company,dc=com"*
*res=ldap.search(:base => treebase, :filter => filter)*
*p ldap.get_operation_result*
*puts "below" *
What is the issue here? I am at a loss and would sincerely appreciate any
feedback.
Thanks,
David
data using ruby ldap. Ruby version is: ruby 2.2.1p85
The credentials are fine: I can connect without issues.
This will eventually be going into a Rails 4 application but just doing a
simple .rb file for now.
When I run 'ruby ldap.rb' I get
*#<OpenStruct code=32, error_message="0000208D: NameErr: DSID-03100238,
problem 2001 (NO_OBJECT), data 0, best match
of:\n\t'DC=enterprise,DC=my-company,DC=com'\n\u0000",
matched_dn="DC=enterprise,DC=my-company,DC=com", message="No Such Object">*
My IT admin set me a screenshot of what our AD attributes are. One of them,
to no surprise, is 'sAMAAccountName', so I'm just trying to do a simple
search on that.
*require 'net/ldap'*
*ldap = Net::LDAP.new :host => "123.456.789.12",*
* :port => 389,*
* :auth => { *
* :method => :simple,*
* :username => "***@my-company.com",*
* :password => "Password"*
* }*
*filter = Net::LDAP::Filter.eq("sAMAccountName", "*")*
*treebase = "dc=Users - Employees,dc=enterprise,dc=my-company,dc=com"*
*res=ldap.search(:base => treebase, :filter => filter)*
*p ldap.get_operation_result*
*puts "below" *
What is the issue here? I am at a loss and would sincerely appreciate any
feedback.
Thanks,
David
--
You received this message because you are subscribed to the Google Groups "Ruby LDAP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-ldap+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Ruby LDAP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-ldap+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.