Theodore – A bot for creating a team in Microsoft Teams

My last posts were all about getting up to speed with the Microsoft Teams PowerShell cmdlets released two weeks ago. Running those cmdlets in an Azure Function creates some nice options in terms of creating a team in Microsoft Teams (still, the wording is just awkward). I’m sure you read about all the governance discussion that services like Teams or Groups start in each environment. Only with proper tooling, you can manage the process of orchestrating your different collaboration features in Office365. To take this idea to the next level, what about using a bot in Teams to handling a users request of creating a new team.

This post describes how you can create a bot for your users that will ask for some data in order to create a new team in Microsoft Teams. The bot will call an http triggered Azure Function that is using PowerShell to handle the requests and has the new Teams cmdlets deployed to be able to create a new team in our tenant.

To code in the git hub repo is based on an example project (  of a bot that shows how the different dialogs in a bot can be wired together. The solution is quite simple and of course no way production ready:

An example dialog of the bot looks like this:

To create this kind of dialog you simply start the interaction with the user with code like this:

The PowerShell script is also pretty small and simple at the moment:

After the script finished our bot receives a http 200 everything ok message and informs the user about the success of the operation.

Modern approvals in Office 365 with Power Automate and Microsoft Teams

During testing creating a team with this approach took around 3-5 seconds from sending the final message to the bot to the created new team in the client.

This simple project only uses two parameters when creating new teams. The one that is important from my perspective is -Alias. You can create multiple teams with the same display name only the alias parameter is unique. If you use the same display name you end up with aliases being pretty random.


Github repo ->

About the Author:

Thomas Goelles @thomyg #SharePoint #Office365 and #Azure, working as head of modern workplace solutions @solvion, Microsoft MVP and P-TSP @MicrosoftAT, co-organizer @SPSVie &

Goelles, T. (2017). Theodore – a bot for creating a team in Microsoft Teams. [online] Available at: [Accessed 19 Jan. 2018].

Share this on...

Rate this Post: