# LDAP syncronization

**URL:** https://forum.mattermost.com/t/ldap-syncronization/14367
**Category:** Troubleshooting
**Created:** [October 31, 2022, 8:51pm UTC](https://forum.mattermost.com/t/ldap-syncronization/14367 "2022-10-31T20:51:40Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![RicardoE105](https://avatars.discourse-cdn.com/v4/letter/r/49beb7/32.png) [@RicardoE105](https://forum.mattermost.com/u/RicardoE105)
#### Post date: [October 31, 2022, 8:51pm UTC](https://forum.mattermost.com/t/ldap-syncronization/14367/1 "2022-10-31T20:51:40Z")

</div>

I set up the LDAP feature in Mattermost, and while the synchronization seems to work fine according to the UI, I cannot see those users listed in the Mattermost users list. What am I missing?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/8/8610b83c004c51021f51596988748419209e8f1b.jpeg)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/a/a8b5845ca3093d91eca2c8167ddd1783f3a3c0f6.jpeg)

---

<div class="post-metadata">

### Author: ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)
#### Post date: [November 1, 2022, 5:47am UTC](https://forum.mattermost.com/t/ldap-syncronization/14367/2 "2022-11-01T05:47:24Z")

</div>

Hi Ricardo,

I think you also need to add them to the team. In your system console under “User Management” → “Teams” click on “Edit” and in the “Groups” section, add the LDAP group which users should automatically be added to your team. Upon the next sync, the users should be created.

---

<div class="post-metadata">

### Author: ![RicardoE105](https://avatars.discourse-cdn.com/v4/letter/r/49beb7/32.png) [@RicardoE105](https://forum.mattermost.com/u/RicardoE105)
#### Post date: [November 1, 2022, 1:24pm UTC](https://forum.mattermost.com/t/ldap-syncronization/14367/3 "2022-11-01T13:24:50Z")

</div>

Thanks for the help @agriesser

I do not have a group filter in my LDAP settings. I should not need that, as group synchronization is an optional field in the LDAP settings. I came across the question below, which I guess explains the issue. Users are not created during synchronization, probably only updated or deleted.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/1/1fd3713345740126835025d202b6d725903d8b1b.png)

---

<div class="post-metadata">

### Author: ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)
#### Post date: [November 2, 2022, 6:31am UTC](https://forum.mattermost.com/t/ldap-syncronization/14367/4 "2022-11-02T06:31:47Z")

</div>

I’m not talking about the group filter, just about the team management.  
I’m using LDAP here on my own and as soon as I create a new user in our active directory, it automatically gets synced to Mattermost and an account is being created, at least I recall that being the case.  
Do you want to add all your LDAP users to Mattermost or do they need to be in a specific group in order to login there?  
Can you post the link to the documentation you found here?

---

<div class="post-metadata">

### Author: ![RicardoE105](https://avatars.discourse-cdn.com/v4/letter/r/49beb7/32.png) [@RicardoE105](https://forum.mattermost.com/u/RicardoE105)
#### Post date: [November 2, 2022, 6:56pm UTC](https://forum.mattermost.com/t/ldap-syncronization/14367/5 "2022-11-02T18:56:17Z")

</div>

> Do you want to add all your LDAP users to Mattermost or do they need to be in a specific group in order to login there?

I want to add all my LDAP users to Mattermost.

> [@agriesser](#):
>
> Can you post the link to the documentation you found here?

[https://docs.mattermost.com/onboard/ad-ldap.html#when-i-first-set-up-and-synchronize-ad-ldap-are-the-users-automatically-created-in-mattermost](https://docs.mattermost.com/onboard/ad-ldap.html#when-i-first-set-up-and-synchronize-ad-ldap-are-the-users-automatically-created-in-mattermost)

---

<div class="post-metadata">

### Author: ![RicardoE105](https://avatars.discourse-cdn.com/v4/letter/r/49beb7/32.png) [@RicardoE105](https://forum.mattermost.com/u/RicardoE105)
#### Post date: [November 14, 2022, 9:23pm UTC](https://forum.mattermost.com/t/ldap-syncronization/14367/6 "2022-11-14T21:23:01Z")

</div>

Any idea what might be happening?

1. Connection test runs fine.
2. Synchronization runs fine and tells me the number of users I have in my LDAP server.
3. When trying to log in with the LDAP user credentials, I get “The email/username or password is invalid.”

I’m using the Mattermost Cloud Enterprise free trial if this is relevant.

---

<div class="post-metadata">

### Author: ![RicardoE105](https://avatars.discourse-cdn.com/v4/letter/r/49beb7/32.png) [@RicardoE105](https://forum.mattermost.com/u/RicardoE105)
#### Post date: [November 14, 2022, 9:35pm UTC](https://forum.mattermost.com/t/ldap-syncronization/14367/7 "2022-11-14T21:35:21Z")

</div>

Attribute mapping that I’m using.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/a/a3a857c845f851bb33343e34d0b7ece3044b639e.png)

---

<div class="post-metadata">

### Author: ![akio](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@akio](https://forum.mattermost.com/u/akio)
#### Post date: [December 29, 2022, 4:40am UTC](https://forum.mattermost.com/t/ldap-syncronization/14367/8 "2022-12-29T04:40:48Z")

</div>

Hi Ricardo,

EnterpriseEdition has two types.  
One of them is “E10” : It’ only possible to use LDAP group synchronization.  
One of them is “E20” : It’ possible to use LDAP group synchronization.

I think The Edition of your use is “E10”. isn’t you?

[https://docs.mattermost.com/about/editions-and-offerings.html](https://docs.mattermost.com/about/editions-and-offerings.html)

---

<div class="post-metadata">

### Author: ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)
#### Post date: [January 18, 2023, 7:18am UTC](https://forum.mattermost.com/t/ldap-syncronization/14367/9 "2023-01-18T07:18:21Z")

</div>

Hi Ricardo,

sorry for the late reply, I was under the wrong assumption that the users are being created immediately after they’ve been synced, but this is not the case, the documentation is right about that - as soon as the user tries to login, it will be created in the database, not earlier or by an automated process.

I think you cannot use the `mail` attribute as a username attribute, I think this needs to be set to `sAMAccountName` (which is the default value). In my setup, I do have the `LoginIdAttribute` set to `sAMAccountName` and can still login with the e-mail address, but there needs to be a valid username stored in the database and the e-mail address is not a valid username, so maybe that’s the problem you’re seeing here.
