How to create a team with PnP PowerShell

Sometimes I like a nice challenge. I came across a Tweet from Joanne Klein with a question about Microsoft Teams provisioning. This article describes how to create a team with PnP PowerShell and the Microsoft Graph.

The question from Joanne

On the 23rd of january I spotted this Tweet and the first response from Drew Madelung pointed me in the right direction for a solution.

My first attempt to create a solution

The following script is the end result of my attempt to recreate the solution suggested by Drew Madelung. I choose to use Microsoft Graph and PnP PowerShell.

Feel free to use it (of course at your own risk ;)).

Breakdown of the solution

Basicly the script has three parts. First of all you need to connect with the Microsoft Graph and get an access token. I am using the latest PnP PowerShell module for this, so make sure you download this module before running the script.

After that you can use a POST request to create an Office 365 Group via the Microsoft Graph. This is the first step in the creation of a Team.

In the second step I am using the Group ID of the reponse to use a PUT request to create a Microsoft Team.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.