Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
powershell-scripts/Add_Users_to_Teams.ps1
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
13 lines (12 sloc)
846 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You need to have the Teams pwoershell module installed first. To do this run | |
# Install-Module -Name MicrosoftTeams -Scope CurrentUser | |
# in a powershell prompt | |
# The csv file must have a header and there must be a column called email | |
# This should have the email addesses of the people you wish to add. | |
# Students will be in the @uni.coventry.ac.uk format | |
$ea=Read-Host "Please enter your own email address" | |
Connect-MicrosoftTeams | |
Get-Team -User $ea | Format-List -Property DisplayName, GroupId | |
$gid=Read-Host "Please enter the group ID of the teams site you wish to add the users too" | |
$usercsv = Read-Host "Please enter the CSV file you wish to use to add the userd (must be in the same directory as the script)" | |
Import-Csv -Path $usercsv | foreach { Add-TeamUser -Verbose -Debug -GroupId $gid -User $_.email} |