Skip to Content
Communication Square LLC Help Center

Add Team user using Powershell and CSV

Written October 2020. Microsoft changes these admin screens often, so the screenshots below may not match what you see today. The sequence of steps is usually still correct — if something looks wrong, tell us and we'll update it.

Description:

This script is used to add members and owners in Teams

The following columns are required in the CSV:

-GroupID: GroupID of the Team

-User: Email of the user

-Role: Owner or members 

Script:

Install-Module -Name MicrosoftTeams

Connect-MicrosoftTeams

Import-Csv -Path " C:\Users\Awais\OneDrive - Communication Square\Desktop\teams.csv" | foreach{Add-TeamUser -GroupId $_.GROUPID -user $_.upn -Role $_.Role}

Last updated on