Skip to content

Powershell script to get Active-Directory users and create a JSON file to add users to Mattermost channels while importing with the bulk import tool.

Notifications You must be signed in to change notification settings

cjohannsen81/mattermost-ad_import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mattermost Active-Directory Import

This Powershell script gets all AD Users based on the given AD group and converts them into a JSON file that can be used for the Mattermost bulk import tool: https://docs.mattermost.com/deployment/bulk-loading.html

It allows to add the team and channels for the users. They will be part of these channels when logging in the first time.

Please note that the Enterprise Edition is needed.

  1. Just call the script (I used a sample Windows 2012 R2 domain controller). Please note that the script name is: import.ps1.

alt text

  1. The result is an import JSON file that matches the specifications of the bulk import tool.

alt text

  1. After you copied the JSON file to the Mattermost server, validate the import using the bulk import tool (/opt/mattermost/bin/): sudo ./platform import bulk /tmp/import.json --validate

alt text

  1. With switching the attribute from --validate to --apply the file import begins.

alt text

  1. You can check the imported user in the System Console of your Mattermost Server.

alt text

  1. Now you can try a login with one of the AD users to check the channel association.

alt text

  1. Finally you should be able to see the associated channels for this user (testchannel and secondone in my demo)

alt text

In case you want to change of enhance the script, feel free to create a pull request.

Author: Christian Johannsen Twitter: cjohannsen81

About

Powershell script to get Active-Directory users and create a JSON file to add users to Mattermost channels while importing with the bulk import tool.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published