Microsoft Teams’ daily users are skyrocketing. From April 2020 to October 2020, their numbers rose more than 50 percent from 75 million to 115 million.
Suppose your company decides to adopt this software for daily internal or external communications. In that case, you might face the manual construction of public/private teams and channels, assign Office 365 users to them, and so on. This procedure might become very time-consuming as the complexity of your company increases.
To solve this problem, I have created a script that takes care of all of this for you by automating the entire process. The only thing you must do is create a JSON file as described below and pass a few parameters to the script.
Configuration file
This JSON file contains all the teams and channels that you want to create in your organization. You can also specify each object’s visibility (private or standard), the users you wish to assign to it, and their roles.
The schema of the JSON is the following,
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://example.com/object1610484731.json",
"title": "root",
"type": "object",
"required": [
"teams"
],
"properties": {
"teams": {
"$id": "#root/teams",
"title": "teams",
"type": "array",
"default": [],
"items": {
"$id": "#root/teams/items",
"title": "items",
"type": "object",
"required": [
"displayname",
"visibility",
"users",
"channels"
],
"properties": {
"displayname": {
"$id": "#root/teams/items/displayname",
"title": "displayname",
"description": "Team display name",
"type": "string",
"default": "",
"examples": [
"public team1"
],
"pattern": "^.*$"
},
"visibility": {
"$id": "#root/teams/items/visibility",
"title": "visibility",
"description": "Team visibility",
"type": "string",
"default": "public",
"enum": ["public", "private"],
"examples": [
"public",
"private"
]
},
"users": {
"$id": "#root/teams/items/users",
"title": "users",
"type": "array",
"default": [],
"items": {
"$id": "#root/teams/items/users/items",
"title": "items",
"type": "object",
"required": [
"email",
"role"
],
"properties": {
"email": {
"$id": "#root/teams/items/users/items/email",
"title": "email",
"description": "User email",
"type": "string",
"default": "",
"format": "email",
"examples": [
"[email protected]"
]
},
"role": {
"$id": "#root/teams/items/users/items/role",
"title": "role",
"description": "User role",
"type": "string",
"default": "owner",
"enum": ["owner", "member"],
"examples": [
"owner",
"member"
]
}
}
}
},
"channels": {
"$id": "#root/teams/items/channels",
"title": "channels",
"type": "array",
"default": [],
"items": {
"$id": "#root/teams/items/channels/items",
"title": "items",
"description": "Team users",
"type": "object",
"required": [
"displayname",
"membershiptype",
"users"
],
"properties": {
"displayname": {
"$id": "#root/teams/items/channels/items/displayname",
"title": "displayname",
"description": "Channels display name",
"type": "string",
"default": "",
"examples": [
"public channel"
],
"pattern": "^.*$"
},
"membershiptype": {
"$id": "#root/teams/items/channels/items/membershiptype",
"title": "membershiptype",
"description": "Channels membership type",
"type": "string",
"default": "standard",
"enum": ["standard", "private"],
"examples": [
"standard",
"private"
]
},
"users": {
"$id": "#root/teams/items/channels/items/users",
"title": "users",
"description": "Channels users",
"type": "array",
"default": [],
"items": {
"$id": "#root/teams/items/channels/items/users/items",
"title": "items",
"type": "object",
"required": [
"email",
"role"
],
"properties": {
"email": {
"$id": "#root/teams/items/channels/items/users/items/email",
"title": "email",
"description": "User email",
"type": "string",
"default": "",
"format": "email",
"examples": [
"[email protected]"
]
},
"role": {
"$id": "#root/teams/items/channels/items/users/items/role",
"title": "role",
"description": "User role",
"type": "string",
"default": "member",
"enum": ["owner", "member"],
"examples": [
"owner",
"member"
]
}
}
}
}
}
}
}
}
}
}
}
}

Join the conversation! Your thoughts help the community grow.