Simple LDAP query

C

Chris Henderson

I'm using ruby-1.8.6 and trying to query my Windows Active Directory
LDAP server. But I'm getting connection failed. I can ping the AD
server, I can resolve the host name or the IP address and I know the
LDAP authentication is working. But I'm still getting error message
when I query it via the following script. The error message I get is
"fail!"

Could anyone please tell me what I'm doing wrong? Do I need to define
the base DN?

#!/usr/bin/ruby
require 'rubygems'
require 'net/ldap'

ldap = Net::LDAP.new
ldap.host = "ldap.domain.com"
ldap.port = 389
ldap.auth "user_ID", "password"
if ldap.bind
print "success!\n"
# authentication succeeded
else
print "fail!\n"
# authentication failed
end
 
G

Glen Holcomb

[Note: parts of this message were removed to make it a legal post.]

What is the value of user_ID?

it needs to be (e-mail address removed)
 
G

Glen Holcomb

[Note: parts of this message were removed to make it a legal post.]

What is the value of user_ID?

it needs to be (e-mail address removed)





--
"Hey brother Christian with your high and mighty errand, Your actions speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)

It probably wouldn't hurt to supply the base either.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,144
Latest member
KetoBaseReviews
Top