Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
# You need to have the Teams pwoershell module installed first. To do this run
# Install-Module -Name MicrosoftTeams -Scope CurrentUser
# in a powershell prompt
# You'll also need to run
# Connect-MicrosoftTeams
# at the command prompt before running the script
$teams_csv="C:\Users\ac9207\OneDrive - Coventry University\Workbench\PowerShell\Master-groups.csv"
$students_csv="C:\Users\ac9207\OneDrive - Coventry University\Workbench\PowerShell\Master-students.csv"
Import-Csv -Path $teams_csv | foreach {
Write-Output $gn
Write-Output $staff
Write-Output $farzana
$group = New-Team -displayname $gn
$gid= $group.GroupId
Write-Output $gid
#Start-Sleep -s 20
#Add-TeamUser -Verbose -GroupId $group -User $faye -Role Owner
Add-TeamUser -Verbose -GroupId $gid -User $farzana -Role Owner
Add-TeamUser -Verbose -GroupId $gid -User $staff -Role Owner
Import-Csv -Path $students_csv | foreach {
if ($gn -eq $ngn) {Add-TeamUser -Verbose -GroupId $gid -User $student}