Microsoft have made available a PowerShell Module for Teams! This has been widely anticipated and a most welcome feature addition to Teams which will help bring scale to deployments where a great number of teams and channels may need to be created by an Administrator. Here’s how to get started:
Installing the Teams PowerShell Module
Open a Windows PowerShell as an Administrator and run the following cmdlet:
Install-Module -Name MicrosoftTeams
Connecting to your Teams Tenant
PS C:\WINDOWS\system32> Connect-MicrosoftTeams -AccountId [email protected]
Next you will see the sign in window where you can enter your password.
Account : [email protected]
Environment : AzureCloud
Tenant : d355b8dc-279f-467d-b57b-2bh9df142c01
TenantId : d355b8dc-279f-467d-b57b-2bh9df142c01
TenantDomain : lab.enableuc.com
Getting a list of all the cmdlets:
PS C:\WINDOWS\system32> Get-TeamHelp
cmdlets
------------------------
Get-Team
Get-TeamUser
Get-TeamChannel
Get-TeamMemberSettings
Get-TeamMessagingSettings
Get-TeamFunSettings
Get-TeamGuestSettings
New-Team
New-TeamChannel
Add-TeamUser
Remove-Team
Remove-TeamChannel
Remove-TeamUser
Set-TeamMemberSettings
Set-TeamMessagingSettings
Set-TeamFunSettings
Set-TeamGuestSettings
Set-TeamPicture
Set-Team
Set-TeamChannel
***
Let’s get a list of teams in our tenant.
PS C:\Program Files\WindowsPowerShell\Modules> get-team
GroupId DisplayName Description
------- ----------- -----------
c1038989-7bd5-4b9e-851c-f427b613ca7b Lab Team 1 Lab Team 1
71f39bc1-eb48-45a5-8a9b-078dd15f21da Lab Test Group Test Team
f9738a58-d76c-4b7c-8e24-97d85dca6536 Another Team Another Team
I expect that the list of cmdlets will grow and improve over time to keep checking back for updates.
Enjoy!