Connect to Microsoft Teams PowerShell
Microsoft Teams PowerShell Modunle
You need install Microsoft Teams module only once. In the next time, run to connect to Microsoft Teams PowerShell.
##Install Modunle and Connect to Microsoft Teams
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force;
Install-PackageProvider -Name NuGet -Force;
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted;
Install-Module -Name MicrosoftTeams;
Connect-MicrosoftTeams
Add members to a Teams group
To check the Group ID of my Team, I will run the following command and copy the Team’s GroupID value.
PS C:\Windows\system32> Get-Team | select groupid, display*
GroupId DisplayName
------- -----------
23c608e9-518b-438a-bdc8-d305fab95bee ROD_California
544f7193-0bb9-4d9f-806a-598695b230dc ROD_Pennsylvania
5550c3eb-2f5b-4cb4-9f57-a55a1d770c95 ROD_Texas
ae050580-90dc-4c8f-b22a-04a107a2b58e ROD_Arizona
660a5081-ea4b-49aa-b552-db50d903217d ROD_Florida
8efc0be3-a204-498e-ab58-c05db4ee808d ROD_Illinois
33f2ab84-cc86-423b-af79-daa4ad5bf7b1 leoguides
89bcd7cd-a9be-49c0-a47b-ed488dcaeca2 ROD_North Carolina
Add the users to my MS Teams Team.
$GroupId = '23c608e9-518b-438a-bdc8-d305fab95bee'
Import-Csv "C:\Temp\Members.csv" |
foreach { Add-TeamUser -GroupId $GroupId -User $_.Member }
Add members to multiple Teams groups
Import-Csv "C:\Temp\Members.csv" |
foreach { Add-TeamUser -GroupId $_.GroupId -User $_.Member }
Check Members
Get-TeamUser -GroupId 23c608e9-518b-438a-bdc8-d305fab95bee | select user
5/5 - (1 vote)