A little news about Microsoft Teams this time, the Version 1 of the Microsoft Teams PowerShell module has been released by the end of April 2019.
This module is composed of 14 CmdLets that will allow you to control the Microsoft Teams lifecycle in your environment.
To install it you can follow this link to the PowerShell Gallery or type the following command inside a PowerShell session:
#To install the latest version of the Microsoft Teams PowerShell module Install-Module -Name MicrosoftTeams #If you want to install another version (to get the beta CmdLets for instance) Install-Module -Name MicrosoftTeams -RequiredVersion 0.9.6
The Version 1 of the Microsoft Teams PowerShell module allow you to run the following CmdLets :
Cmdlet | Description |
Connect-MicrosoftTeams | Connects to the Microsoft Teams environment |
Disconnect-MicrosoftTeams | Disconnects from the Microsoft Teams environment |
Get-Team | Retrieves teams |
Get-TeamChannel | Gets all the channels for a team |
Get-TeamHelp | Provides a list of commands for Microsoft Teams |
Get-TeamUser | Returns the users of a specific team |
New-Team | Provisions a new Team, or converts a group to a team |
New-TeamChannel | Adds a new channel to a team |
Add-TeamUser | Adds an owner or member to the team |
Remove-Team | Deletes a team |
Remove-TeamChannel | Deletes a channel |
Remove-TeamUser | Removes an owner or member from a team |
Set-Team | Updates properties of a team |
Set-TeamChannel | Updates Team channel information |
Note that we will still edit Policies and Configuration using the Skype for Business PowerShell module.
For simplicity and discoverability purpose, the following beta commands are not part of the version 1. Their functionalities are consolidated with Get-Team and Set-Team :
– Get-TeamFunSettings
– Get-TeamGuestSettings
– Get-TeamMemberSettings
– Get-TeamMessagingSettings
– Set-TeamFunSettings
– Set-TeamGuestSettings
– Set-TeamMemberSettings
– Set-TeamMessagingSettings
Here are some examples of what you can do with the Microsoft Teams PowerShell Module :
#Connect to the Teams Environment Connect-MicrosoftTeams #Retrieve Teams from the environment Get-Team #Create a Team New-Team -DisplayName TestTeams -Visibility Private -Owner $owner #Email address #Modify some settings $MyTeam = Get-Team -DisplayName TestTeams Set-Team -GroupId $MyTeam.GroupId -DisplayName 'WebSite Improvements' New-TeamChannel -GroupId $MyTeam.GroupId -DisplayName 'Test' Set-TeamChannel -GroupId $MyTeam.GroupId -CurrentDisplayName 'Test' -NewDisplayName 'Navigation UI/UX' #Check if Private Teams have less than two Owners $objAllPrivateTeams = Get-Team -Visibility Private foreach ($team in $objAllPrivateTeams) { $teamOwner = Get-TeamUser -GroupId $team.GroupId -Role Owner if ($teamOwner.Count -lt 2) {Write-Host "$($team.DisplayName) does not match compliance"} }
Finally, you can find bellow some helpful links in case you want further information about Microsoft Teams and PowerShell :
Microsoft Teams on GitHub
Microsoft Docs CmdLets Documentation
Microsoft Docs Teams PowerShell overview
See you soon in the blog !