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

image

Get-Module MicrosoftTeams -ListAvailable|fl

image

Get-Command –Module MicrosoftTeams

image

Get-TeamHelp

image

Connect to Microsoft Teams

$cred = Get-Credential
Connect-MicrosoftTeams –Credential $cred

image

Create Teams and work with a group with Azure AD

Create Teams with access to private

New-Team -DisplayName “TeamsLAB01” -AccessType Private

image

Create Teams with the creator as a member

New-Team -DisplayName “TeamsLAB03” -AccessType Private -AddCreatorAsMember $true

image

New-Team -DisplayName “TeamsLAB05” -AccessType Private -Alias TeamsLAB05

image

New-Team -DisplayName “TeamsLAB04” -AccessType Public –Verbose

image

Get-Team

image

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

image

You may also like...

Leave a Reply

error: Content is Protected !!
%d bloggers like this: