I want to create a new team in Microsoft Teams with dynamic membership using powershell using the modules MicrosoftTeams and AzureADPreview
I can create a new team using the command
New-Team -DisplayName "NewTeam" -Description "New Team" -MailNickName "NewTeam" -Visibility "Private"
When I try to set the group type to Dynamic Memberehip with the command,
Set-AzureADMSGroup -Id "xxx" -GroupTypes "DynamicMembership" -MembershipRuleProcessingState "On" -MembershipRule "user.mailNickname -eq ""yyy"""
I get the following error message:
Set-AzureADMSGroup : Error occurred while executing SetMSGroup
Code: Request_BadRequest
Message: One or more properties contains invalid values.
InnerError:
RequestId: e82c8ab7-c0a1-4631-b983-fc5cb2b0e860
DateTimeStamp: Mon, 06 Jul 2020 12:13:37 GMT
HttpStatusCode: BadRequest
HttpStatusDescription: Bad Request
HttpResponseStatus: Completed
At line:1 char:1
+ Set-AzureADMSGroup -ID "db9e3933-1883-4d3a-88fe-f95d29b5d8c6" -Securi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-AzureADMSGroup], ApiException
+ FullyQualifiedErrorId : Microsoft.Open.MSGraphBeta.Client.ApiException,Microsoft.Open.MSGraphBeta.PowerShell.SetMSGroup