Microsoft Teams and PowerShell (part 1)
The Microsoft Teams PowerShell commands mean more ways to interact with, and to add that first layer of automation to management with some good deployment, access changing and settings changing scripts.
The PowerShell module for Microsoft Teams makes the administration easier and you can do some actions such: Add a large number of members to a team or Create a self-service tool for the help desk.
The Basic PowerShell action for Microsoft Teams
First, we need to install the Microsoft Teams module and know what is the commands that we can play with.
Install-Module and show commands
Install-Module MicrosoftTeams –Force
Get-Module MicrosoftTeams -ListAvailable|fl
Get-Command –Module MicrosoftTeams
Get-TeamHelp

Connect to Microsoft Teams
$cred = Get-Credential
Connect-MicrosoftTeams –Credential $cred
Create Teams and work with a group with Azure AD
Create Teams with access to private
New-Team -DisplayName “TeamsLAB01” -AccessType Private
Create Teams with the creator as a member
New-Team -DisplayName “TeamsLAB03” -AccessType Private -AddCreatorAsMember $true
New-Team -DisplayName “TeamsLAB05” -AccessType Private -Alias TeamsLAB05
New-Team -DisplayName “TeamsLAB04” -AccessType Public –Verbose
Get-Team
Sometimes it’s better to add the AzureAD module to identify the group with a group name and not group id.
Install-Module AzureAD
Connect-AzureAD -Credential $cred
Get-AzureADGroup -SearchString “TeamsLAB01”
$GroupID=(Get-AzureADGroup -SearchString “TeamsLAB01”).objectid
Get-TeamUser -GroupId $GroupID
Get-TeamFunSettings -GroupId $GroupID | fl