LDAP synchronization and equal usernames

Hello. We have enabled AD/LDAP synchronization.
When user John Smith (username: j_smith, email: j_smith@company.net) was fired we deactivated his account on mattermost. We can’t delete it, because we want to save topics and posts with him.
After one year we hired new employee with name Jack Smith (username: j_smith, email: j_smith@company.net )
And mattermost activated John’s account for this new guy (for Jack).
What should we do to avoid this situation in the future?

Hi @Ivan,

In this second scenario where a user later comes in with the same username as a previous (now inactive) user, Mattermost can’t have two different users with the same username. It would be expected that 1) if you want to preserve the older user you’d have to change that older username, OR have the new user have a different username to begin with. Or 2) If you don’t need to preserve the older user’s history, then it seems that deleting the older using CLI is the right way to go.

Let me know if this helps?

Hi @amy.blais
We want to preserve old user’s history.
So the first case is ok with us. And a few question about it:

  1. How should we change username? Can we make it using CLI or we should make UPDATE SQL query directly in DB?
  2. Can we change only username or email should be unique too?

Hi @Ivan,

  1. You can change it directly in the Active Directory.
  2. Changing the username should be enough.

Please let us know any further questions,

1 Like