# Dollibar - Active directory connecting but not fetching users

**URL:** <https://www.dolibarr.org/forum/t/dollibar-active-directory-connecting-but-not-fetching-users/23625>\
**Category:** Installing my Dolibarr\
**Tags:** Windows, Help\
**Created:** [April 17, 2023, 6:30am UTC](https://www.dolibarr.org/forum/t/dollibar-active-directory-connecting-but-not-fetching-users/23625 "2023-04-17T06:30:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gnrexe](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/g/9d8465/32.png) [@gnrexe](https://www.dolibarr.org/forum/u/gnrexe)\
**Post date:** [April 17, 2023, 6:30am UTC](https://www.dolibarr.org/forum/t/dollibar-active-directory-connecting-but-not-fetching-users/23625/1 "2023-04-17T06:30:24Z")

</div>

Hello, everyone!

**Summary:** I have managed to connect my new Dolibarr installation to Active Directory but I can not make it fetching the users. Could you please give a clue where I should dig into?

**Details:**

Here is my setup:

```auto
OS: Windows Server 2019
PHP php-8.1.18-Win32-vs16-x64
MySQL v. 8.0.32
Apache 2.4.57
Dolibarr ver: 16.0.4 & 17.0.1 (tried both - faced the same issue)

```

I am a new in both installing and using the Dolibarr solution. I have chosen the manuall installation method according to the guide [Manual installation on Windows - Dolibarr ERP CRM Wiki](https://wiki.dolibarr.org/index.php?title=Manual_installation_on_Windows)

Just after installaiton is finished I am trying to setup Dolibarr-Windows Active Directory integration.

Here are my steps:

1. Activate php\_ldap.dll extension
2. Create a special read-only account in the AD
3. Activate ldap module in Dolibarr
4. Configure the module according to the [HOWTO: LDAP + ActiveDirectory instructions (with authentication) for Dolibarr 12](https://www.dolibarr.org/forum/t/howto-ldap-activedirectory-instructions-with-authentication-for-dolibarr-12/19541) manual

**Global parameters** tab:

> **Users and groups synchronization:** LDAP → Dolibarr  
> **Contacts’ synchronization:** No  
> **Type:** Active Directory  
> **Version:** Version 3  
> **Primary server:** ldap://_ **myserverdnsname** _  
> **Server port:** 389  
> **Server DN:**  
> **Use TLS:** No  
> **Password hash type:** MD5  
> **Administrator DN:** CN=msa-Dolibarr-APP,OU=Service accounts  
> **Administrator password:** \*\*\*\*

Here I am getting a successful result on clicking **TEST LDAP CONNECTION** button

```auto
 TCP connect to LDAP server successful 
 Connect/Authenticate to LDAP server successful
 LDAP server configured for version 3

```

**Users** tab:

> **Users’ DN:** Copied-pasted distinguishedname of my OU from AD  
> **List of objectClass:** top,user (tried all variants)  
> **Search filter:** empty (also tried all variants)
> 
> Full name: cn  
> Name: sn  
> Login (samba, activedirectory): samaccountname (radiobutton Key In LDAP is on)  
> Email address: mail
> 
> - all other fields are empty

Here when I am clicking **TEST LDAP SEARCH** button nothing happens, no results on the page or someting.

Meanwhile dolibarr.log file content looks like:

> 2023-04-17 06:21:25 DEBUG 172.17.0.166 Ldap::connect\_bind try bindauth for activedirectory on ldap:/myserverdnsname user=CN=msa-Dolibarr-APP,OU=Service accounts,password=\*\*\*\*\*\*\*\*\*\*  
> 2023-04-17 06:21:25 DEBUG 172.17.0.166 Ldap::connect\_bind return=2  
> 2023-04-17 06:21:25 DEBUG 172.17.0.166 Ldap::getRecords search=\* userDn=OU=Users, useridentifier=samaccountname attributeArray=array(samaccountname,cn,sn,mail) activefilter=1  
> 2023-04-17 06:21:25 DEBUG 172.17.0.166 Ldap::bindauth serverType=activedirectory searchUser=CN=msa-Dolibarr-APP,OU=Service accounts,  
> 2023-04-17 06:21:25 DEBUG 172.17.0.166 — End access to /dolibarr/admin/ldap\_users.php

Is there something else I should enable on the php / apache side to make this AD user fetching work?

Many thanks in advance for your replies!
