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!
Thank you for this module, I have been messing around with it ever since I saw the notification it was out. But I am running into a couple of errors that I don't understand. When trying to run get-teamguestsettings of get-teamfunsettings with -groupid and putting an ID for a group I get returned a "Error occured while executing, code General Exception, Message Object reference not set to an instance of an object. I have tried multiple syntax and attempts. Any thoughts.
Posted by: Steve_bedell | November 06, 2017 at 09:12 AM
This is a known issue at the moment however I am not aware of an ETA for a bug fix. If I hear anything more will post back here.
Dino
Posted by: Dino Caputo | November 06, 2017 at 09:38 AM