Forum Discussion
Luca VALENTINO
Mar 21, 2020Copper Contributor
Create Teams from csv
I am trying to create Teams from a CSV file My Csv: Mail TeamsName TeamsDescription Type TypeTemplate Owners EV0123 EV - Prova Descrizione1 Private EDU_Class email@dom.it SN0123 ...
EDU_ictGeek
Apr 23, 2020Brass Contributor
Hi there, i had found a very similar script in another website.
a guy called Andrew West had said in the comments that that the alias and the AccessType should be changed.
Its in: https://www.jijitechnologies.com/blogs/create-teams-microsoft-teams-powershell
Do let us know if your script works with those changes.
Luca VALENTINO
Apr 29, 2020Copper Contributor
I managed to create the class groups.
Now I want to insert the members in the various groups but nothing
#Connettere a Teams
#Connect-MicrosoftTeams
function Add-Users
{
param(
$ImportPath
#,$CurrentUsername,$Role
)
Process
{
Import-Module MicrosoftTeams
$cred = Get-Credential
$username = $cred.UserName
Connect-MicrosoftTeams -Credential $cred
#$teamusers = Import-Csv -Path $ImportPath
try{
$teamusers = $Users -split ";"
Write-Host "Start add the users: " $Users
if($teamusers)
{
for($j =0; $j -le ($teamusers.count - 1) ; $j++)
{
if($teamusers[$j] -ne $CurrentUsername)
{
Add-TeamUser -GroupId $GroupName -User $teamusers[$j]
}
}
}
}
Catch
{
}
}
}
Add-Users -ImportPath "C:\PC\OFFICE 365\Gruppi_membri_team.csv"