PowerShell Genie

MicrosoftTeams module: setup and commands

Module 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

Connect to Microsoft Teams, inspect teams and policies, and account for role permissions and eventual consistency before judging a change unsuccessful.

Getting it

Install-PSResource -Name MicrosoftTeams from the PowerShell Gallery, then authenticate with Connect-MicrosoftTeams.

Examples

1PS> Get-Team
Show reference output
1 GroupId DisplayName Visibility
2 ------- ----------- ----------
3 6f23d2f1-5adc-4f65-9283-2d8c0ad5f122 IT Operations Private
1PS> Get-TeamUser -GroupId 00000000 - 0000 - 0000 - 0000 - 000000000000
Show reference output
1 User Name Role
2 ---- ---- ----
3 user@example.test Sample User Owner

What it is for

Use it for team and channel inventory and for owner coverage checks ahead of a governance review. Policy assignment cmdlets also live here, which is how calling and meeting settings get applied in bulk.

Typical tasks

  • List teams with visibility and archive state
  • Find teams with one owner or none
  • Enumerate channels including private ones
  • Audit guest membership across teams
  • Assign calling or meeting policies in bulk
  • Report team creation dates for lifecycle work

Check the installed version

1PS> Get-Module -ListAvailable MicrosoftTeams | Select-Object Name, Version, Path
2PS> Get-Command -Module MicrosoftTeams

Compare the module path and version with the session used by your scheduled task or automation account. Use it for team and channel inventory and for owner coverage checks ahead of a governance review. Policy assignment cmdlets also live here, which is how calling and meeting settings get applied in bulk.

Primary documentation

Microsoft 365, Entra and Azure documentation

Continue
Genie guideMicrosoftTeams module: setup and commands

Connect to Microsoft Teams, inspect teams and policies, and account for role permissions and eventual consistency before judging a change unsuccessful.