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 ...
MariusPretorius
Apr 26, 2021Steel Contributor
It seems your code is missing a function name and opening curly bracket at the beginning and a closing curly bracket below your last line. Your code looks like this:
function Create-Channel
{
..
.
Create-NewTeam -ImportPath "C:\Users\Admin1234\Desktop\1.csv"
It should read like this: (I'm only including the missing code)
Function New-TeamsFromCSV
{
function Create-Channel
.
.
.
Create-NewTeam -ImportPath "C:\Users\Admin1234\Desktop\1.csv"
}
Obviously, you have to take a few steps for your code to execute in PowerShell:
- you need to use the PowerShell command line to import the module
import-module TheModuleName.psm1
- I prefer to run PowerShell in Administrator mode to make sure I don't run into permissions problems
- The name of the module you need to import is the (path and the )name of your .psm1 file
- and call the function (run it) as shown below.
New-TeamsFromCSV
Because you are connecting to Teams Admin, you will be asked for your credentials. You need to be a Teams Administrator and provide that username/email address and password. Thereafter you will be flying!
RicMercene
Apr 26, 2021Copper Contributor
Good day!
Thank you for your response.... I will definitely study and try your program and instruction...
Cheers!
Best Regards. 🙂