I’m currently working with Microsoft support on a ticket related to updating the value of CreationOption
for an M365 Group, as discussed in this post: M365 Group: update value of CreationOption. While awaiting a resolution, I attempted to clone the problematic Team group to a new Team-enabled M365 group.
However, I’ve encountered errors during the cloning process and am seeking insights or suggestions from the community. Specifically, I’m wondering if there are adjustments I can make to the scope permissions or other settings to troubleshoot the issue.
Below is the PowerShell script I’ve used for the cloning attempt, along with the error message received:
PowerShell
Install-Module Microsoft.Graph.Teams -Force
Import-Module Microsoft.Graph.Teams -MinimumVersion 2.15.0
Connect-MgGraph -Scopes Group.Read.All, Team.ReadBasic.All, TeamSettings.Read.All, TeamSettings.ReadWrite.All
# Get the Teams you have access to
##$teams = Get-MgTeam
# List all teams with their IDs
##$teams | Select-Object DisplayName, Id | Sort DisplayName
# Define parameters for the new team
$params = @{
displayName = "Problem Team Copy"
description = "Testing copy of Problem Team"
mailNickname = "problemcopytest"
partsToClone = "apps,tabs,settings,channels"
visibility = "private"
}
$teamId = "8xxxxx88-xx8x-8xx8-8888-896x7x019xx4"
Copy-MgTeam -TeamId $teamId -BodyParameter $params
Error
Copy-MgTeam : Unable to fetch team thread: Failed to execute Skype backend request GetThreadRequest.
Status: 403 (Forbidden)
ErrorCode: Forbidden
Date: 2024-03-06T13:28:33
Headers:
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 8xx8xx8x-88xx-88x8-8x8x-514xx5x4x4x1
client-request-id : 8x88xx88-88x8-88xx-8xxx-822x560x93x2
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"North Central US","Slice":"E","Ring":"3","ScaleUnit":"003","RoleInstance":"CH01EPF0002DB18"}}
Date : Wed, 06 Mar 2024 13:28:32 GMT
At line:15 char:1
+ Copy-MgTeam -TeamId $teamId -BodyParameter $params
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ TeamId = 8xxx...ionJsonSchema }:<>f__AnonymousType3`3) [Copy-MgTeam_Clone], Exception
+ FullyQualifiedErrorId : Forbidden,Microsoft.Graph.PowerShell.Cmdlets.CopyMgTeam_Clone
Any advice or guidance on resolving this error and successfully cloning the Microsoft Teams group would be greatly appreciated.
2
Answers
If you're encountering issues with Team-enabled Microsoft 365 Groups sourced from the cloud, configured for Dynamic Group Membership via rules, and experiencing sporadic failures in honoring these rules for member (and/or owner) access to Teams, this solution might be applicable to your situation.
Despite being an owner of a Group for several weeks, it appeared that the error encountered while running the
Copy-MgTeam
command stemmed from access issues with backend systems.Granting new owner access seemed to be impacted by the issue most of the time. Once the solution was effective, owner permissions worked as expected, and the
Copy-MgTeam
command worked properly too without error.Self-Solution
Important: Backup the Dynamic membership rules if necessary before following these steps.
Confirm any newly grant Team "Owners" and "Members" access is back working.
Confirm from Teams desktop app as owner from the Manage Team option, that all members are assigned per the dynamic membership rules as expected.
Tip
Begin by confirming that an existing owner of the Team can access the 'Manage Team' option in the Teams app. Compare the Teams app members with all the M365 admin portals against the group's membership.
If discrepancies are observed between the membership displayed in the Teams app and the expected membership shown in the M365 admin portals. Switching the Group configuration to 'assigned,' removing all members explicitly, allowing sufficient time for replication, and then reverting the configuration back to 'Dynamic' may resolve.
When I executed the same script in my environment it worked successfully:
The team got cloned successfully like below:
With the same permissions as you, I am able to clone the team.
If still the issue persists, check the below:
Team.Create
permission is required to clone the team. If still the error occurs then pass scope asTeam.Create
.