Discussion:
[ruby-ldap] Ruby LDAP Search with correct AD credentials, message="No Such Object"
David Pardy
2015-11-20 17:49:32 UTC
Permalink
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
--
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.
Jerry Cheung
2015-11-21 19:05:48 UTC
Permalink
Hi David,

Unfortunately, I don't have an AD license and install to test with. It may
help to specify the Net::LDAP library version (puts Net::LDAP::VERSION) in
case anyone has run into the problem.
Post by David Pardy
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,*
* :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.
Matt Davies
2015-11-21 19:41:53 UTC
Permalink
*("sAMAccountName"*

'sAMAAccountName',

It's described differently in your post.

Capitalisation is the cause of 43% of computer problEms

PermissIONs second
Post by Jerry Cheung
Hi David,
Unfortunately, I don't have an AD license and install to test with. It may
help to specify the Net::LDAP library version (puts Net::LDAP::VERSION) in
case anyone has run into the problem.
Post by David Pardy
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,*
* :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
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.
David Pardy
2015-11-23 13:46:36 UTC
Permalink
Hi Jerry, the version is 0.12.0. And @Matt Davies, that was a typo on my
part: it is indeed sAMAccountName in the ruby code.
Post by Jerry Cheung
Hi David,
Unfortunately, I don't have an AD license and install to test with. It may
help to specify the Net::LDAP library version (puts Net::LDAP::VERSION) in
case anyone has run into the problem.
Post by David Pardy
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,*
* :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.
Loading...