Forum Discussion

adamsonc's avatar
adamsonc
Copper Contributor
Jun 22, 2020
Solved

Creating Private Channels from a CSV file

Hi all,

I have existing teams that I'd like to create plus thirty private channels for.

 

I have these private channel names in a CSV file with headers such as:

cnamectype
Group 001Private

 

I tried using this code: 

 

 

Import-csv -path "C:\xxxx" | foreach{New-TeamChannel -GroupId GROUPID -DisplayName $_.cname -MembershipType $_.ctype}

 

 

However, the error that keeps being return is:

 

 

New-TeamChannel : A parameter cannot be found that matches parameter name 'MembershipType'.
At line:1 char:159
+ ... -4f95-af21-868941f09af1 -DisplayName $_.cname -MembershipType $_.ctyp ...
+                                                   ~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [New-TeamChannel], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.TeamsCmdlets.PowerShell.Custom.NewTeamChannel

 

 

  Please can someone assist me here.

Resources