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.
- Just call the script (I used a sample Windows 2012 R2 domain controller). Please note that the script name is: import.ps1.
- The result is an import JSON file that matches the specifications of the bulk import tool.
- 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
- With switching the attribute from --validate to --apply the file import begins.
- You can check the imported user in the System Console of your Mattermost Server.
- Now you can try a login with one of the AD users to check the channel association.
- Finally you should be able to see the associated channels for this user (testchannel and secondone in my demo)
Author: Christian Johannsen Twitter: cjohannsen81