You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

创建仅含所有者的组后添加Team失败,报错GetGroupMembersMezzoCountAsync执行失败

问题:创建仅含所有者的组后,无法通过New-MgTeam转换为Microsoft Teams

我先创建了一个仅包含单个所有者的Unified组(脚本执行成功),但调用New-MgTeam将该组转换为Team时失败,此前该流程可正常运行。

错误详情

Failed to execute Templates backend request CreateTeamFromGroupWithTemplateRequest. Request Url: https://teams.microsoft.com/fabric/amer/templates/api/groups/(group ID)/team, Request Method: PUT, Response Status Code: NotFound
响应头:
Strict-Transport-Security: max-age=2592000
x-operationid: 4891d546ce7d4cc1b7628971535f4589
x-telemetryid: 00-4891d546ce7d4cc1b7628971535f4589-f648563539f19266-01
X-MSEdge-Ref: Ref A: C77457E24A6040CF833842B3D48AEA55 Ref B: CH1AA2020613029 Ref C: 2023-04-28T16:38:14Z
Date: Fri, 28 Apr 2023 16:38:14 GMT
错误信息:{"errors":[{"message":"Failed to execute GetGroupMembersMezzoCountAsync.","errorCode":"Unknown"}],"operationId":"4891d546ce7d4cc1b7628971535f4589"}

执行脚本

创建组的脚本(执行成功)

$GroupOwner = (Get-MgUser -UserId $GroupOwnerEmail).Id
$Owner = "https://graph.microsoft.com/v1.0/users/" + $GroupOwner
$NewGroupParams = @{
    "displayName" = $TeamName
    "mailNickname"= $TeamMail
    "description" = $TeamDesc
    "owners@odata.bind" = @($Owner)
    "groupTypes" =  @(
                       "Unified"
                     )
    "mailEnabled" =  "true"
    "securityEnabled" = "true"
    "assignedLabels" = @(
                        @{"LabelId"=$SensitivityLabelId}
                        )
}
$Group = New-MgGroup -BodyParameter $NewGroupParams -ErrorAction Stop

转换为Team的脚本(执行失败)

$NewTeamParams = @{
  "template@odata.bind"="https://graph.microsoft.com/v1.0/teamsTemplates('standard')"
  "group@odata.bind"="https://graph.microsoft.com/v1.0/groups('$($Group.Id)')"
}
New-MgTeam -BodyParameter $NewTeamParams -ErrorAction Stop

可尝试的解决方法

  • 等待组同步完成:创建Unified组后,Azure AD与Teams服务之间可能存在同步延迟,不要立即执行转换操作。建议添加30-60秒的延迟后再调用New-MgTeam。
  • 添加普通成员到组:错误提示涉及GetGroupMembersMezzoCountAsync失败,推测可能是组只有所有者没有普通成员导致的。尝试在创建组后先添加至少一个普通用户到组中,再执行转换。
  • 验证权限有效性:确认执行脚本的账号拥有Group.ReadWrite.All和Team.Create权限,且权限已生效(刚分配的权限可能需要等待15-30分钟)。
  • 排查敏感度标签影响:组使用了敏感度标签,部分标签配置可能限制组转换为Teams的操作。可以尝试移除敏感度标签后重新测试流程。
  • 直接创建Teams:绕过先组后转换的流程,直接使用New-MgTeam创建Teams(同时生成关联组),示例命令如下:
$NewTeamParams = @{
  "displayName" = $TeamName
  "mailNickname" = $TeamMail
  "description" = $TeamDesc
  "owners@odata.bind" = @($Owner)
  "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')"
  "assignedLabels" = @(
    @{"LabelId"=$SensitivityLabelId}
  )
}
New-MgTeam -BodyParameter $NewTeamParams -ErrorAction Stop

内容的提问来源于stack exchange,提问作者Steve-o-rama309

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 18:34:57