I'm trying to make Drupal work with ActiveDirectory just for authentication. I'm using Lightweight Directory Access Protocol.

I always get this message:

Warning: ldap_search(): Search: No such object in LdapServer->search() (line 257 of D:\wwwroot\drupal\sites\all\modules\ldap\ldap_servers\LdapServer.class.php).
Test sandbox-edu LDAP Server Configuration Binding with DN for non-anonymous search ([email protected]). Using password entered in form.
Successfully bound to server
Failed to find test user userone by searching on sAMAccountName = user one.
No such object

Here are the settings of the Server Properties:

name = sandbox-edu
status = 1
type = ad
address = LDAP://
port = 389
tls = 0
bind_method = 1
basedn = Array
binddn = [email protected]
user_dn_expression = cn=%username,%basedn
user_attr = sAMAccountName
mail_attr =
ldap_to_drupal_user =
testing_drupal_username = userone

Can anyone who were able to get this module working with ActiveDirectory show us a sample of the setting?

If there's any other way other than using this module, please also recommend. I really need Drupal to work with ActiveDirectory for authentication because we have many students here.

2 Answers 2


I have the following set of parameters that allow authentication by Active Directory 2003:

server type: "Active Directory LDAP"
server address: ad.example.com
ldap port: 389
binding method for Searches: Bind with Users Credentials
base DNs for LDAP user entries: cn=users,dc=example,dc=com
username attribute: sAMAccountName
expression for user DN: %[email protected]
email attribute: mail

I think the problem mainly stems from the fact that AD typically does not have the login name in the LDAP DN.


If you are interested in a SSO module for Drupal you could look at my answer of a previous question here:

Automated login with LDAP always returns error

Or read below:

Perhaps not a direct answer to you question about the LDAP module but I managed to enable SSO in a Windows domain environment with the Webserver authentication (https://www.drupal.org/project/webserver_auth) module.

You need to force Windows Authentication in your IIS site and disable Anonymous authentication. The Webserver authentication module is also capable of creating accounts when a Windows Domain user is visiting your site and is not registered in Drupal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.