Skip to content
Permalink
main
Switch branches/tags

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?
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"
$faye="ac9207@coventry.ac.uk"
$farzana="aa4015@coventry.ac.uk"
Import-Csv -Path $teams_csv | foreach {
$gn=$_.Group_Name
$staff=$_.Email
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 {
$ngn=$_.PT_Teams_site
$student=$_.Email
if ($gn -eq $ngn) {Add-TeamUser -Verbose -GroupId $gid -User $student}
}
}