-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-team.ps1
More file actions
53 lines (36 loc) · 1.79 KB
/
create-team.ps1
File metadata and controls
53 lines (36 loc) · 1.79 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#lets create a team
#We need the name of the team
#$teamname = Read-Host "Please type the synergetic code i.e. 09DRA4 of the class you want to create a team for"
$teamname = "Prep"
#We need a csv of the teachers
$teachers = "c:\teachers.csv"
#We need to know who will be the team owners
$teamowners = Import-Csv $teachers
#We need to a csv of the leadership
$leadership = "c:\leadership.csv"
#We need to know who will be leadership team owners
$leadershipowners = Import-Csv $leadership
#We need a csv of the specialists
$specialists = "c:\specialists.csv"
#We need to know who will be specialists owners
$specialistsowners = Import-Csv $specialists
#We need the csv of the channels
$channellist = "c:\channels.csv"
#We need the name of the channels to be created
$channelnames = Import-Csv $channellist
#We need the list of students to be added to the team
$students = "C:\students.csv"
#We need to know who the team members will be
$teammembers = Import-Csv $students
#Now we make the team
$theteam = New-Team -DisplayName $teamname -Description $teamname -template EDU_Class
#Add the channels from $channelnames
foreach ($channel in $channelnames) {New-TeamChannel -GroupId $theteam.groupid -DisplayName $channel.class}
#Add the leadership from $leadershipowners
foreach ($leader in $leadershipowners) {Add-TeamUser -GroupId $theteam.groupid -User $leader.email -Role Owner}
#Add the teachers from $teamowners
foreach ($owner in $teamowners) {Add-TeamUser -GroupId $theteam.GroupId -User $owner.email -Role Owner}
#Add the specialists from $specialistsowners
foreach ($special in $specialistsowners {Add-TeamUser -GroupId $theteam.GroupId -User $special.email -Role Owner}
#Add the students from $teammembers
foreach ($member in $teammembers) {Add-TeamUser -GroupId $theteam.groupid -User $member.email -Role Member}