-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNew-Team-Type-Class.ps1
38 lines (27 loc) · 1.12 KB
/
New-Team-Type-Class.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Script para generar un Equipo en Microsoft Teams para Clases del centro educativo
Import-Module MicrosoftTeams
$account = Get-Credential
Connect-MicrosoftTeams -Credential $account
$DisplayName = "CAPILLA PRIMARIA"
$Alias = "CapillaPrimaria"
$Template = "EDU_Class"
# Dueños del Team
$Owner = "[email protected]"
# Arreglos para asistentes del profesor y los estudiantes
$CoOwners = @()
# Arreglo de estudiantes dividido por comma
$Students = @()
$new_team_id = ( New-Team -DisplayName $DisplayName -Description $Description -Owner $Owner -Alias $Alias -Template $Template )
for ($i = 0; $i -lt $CoOwners.count; $i++)
{
Write-Output "Agregando la cuenta de $($CoOwners[$i]) como maestro"
Add-TeamUser -GroupId $new_team_id.GroupId -User $CoOwners[$i] -Role Member
Add-TeamUser -GroupId $new_team_id.GroupId -User $CoOwners[$i] -Role Owner
}
for ($i = 0; $i -lt $Students.count; $i++)
{
Write-Output "Agregando la cuenta de $($Students[$i]) como estudiante"
Add-TeamUser -GroupId $new_team_id.GroupId -User $Students[$i] -Role Member
}
Write-Output "Nuevo Team creado: $($new_team_id)"
Disconnect-MicrosoftTeams