Description
Reporting an Issue or Missing Feature
Since yesterday we are facing issues with our Teams provisioning which relies on PnP Powershell. In our scripts we are using New-PnPTeamsTeam cmdlet and most of the times it is working fine. However, in some cases the command returns an error "Not Found (404): No Team found with Group id ". This has been working fine for quite a while now and suddenly started to behave like mentioned.
UPDATE 03.03.2025: I can now confirm that even after the update to 2.12.0 we are seeing this issue. I was hoping the update did fix this issue as I didn't receive any additional errors since implementing it last week. However, today the issues re-appeared. So it defnitely seems to be an issue. It looks like the issues happens when providing the members and / or owners properties to set them during creation of a team if I am not completely wrong: https://github.com/pnp/powershell/blob/master/src/Commands/Utilities/TeamsUtility.cs#L257
Expected behavior
New-PnPTeamsTeam finishes without error and returns the created team.
Actual behavior
New-PnPTeamsTeam sporadically fails with error "Not Found (404): No Team found with Group id "
Error / Stacktrace (Group ID has been anonymized):
Exception of type 'PnP.PowerShell.Commands.Model.Graph.GraphException' was thrown. Data : System.Collections.ListDictionaryInternal Source : PnP.PowerShell HResult : -2146233088 StackTrace : at PnP.PowerShell.Commands.Utilities.REST.GraphHelper.SendMessage(Cmdlet cmdlet, PnPConnection connection, HttpRequestMessage message, String accessToken) in c:\build\src\Commands\Utilities\REST\GraphHelper.cs:line 366 at PnP.PowerShell.Commands.Utilities.REST.GraphHelper.PostInternal[T](Cmdlet cmdlet, PnPConnection connection, String url, String accessToken, HttpContent content, IDictionary2 additionalHeaders, Boolean propertyNameCaseInsensitive) in c:\build\src\Commands\Utilities\REST\GraphHelper.cs:line 293 at PnP.PowerShell.Commands.Utilities.REST.GraphHelper.Post[T](Cmdlet cmdlet, PnPConnection connection, String url, T content, String accessToken) in c:\build\src\Commands\Utilities\REST\GraphHelper.cs:line 282 at PnP.PowerShell.Commands.Utilities.TeamsUtility.NewTeam(Cmdlet cmdlet, String accessToken, PnPConnection connection, String groupId, String displayName, String description, String classification, String mailNickname, GroupVisibility visibility, TeamCreationInformation teamCI, String[] owners, String[] members, Guid[] sensitivityLabels, TeamsTemplateType templateType, Nullable
1[] resourceBehaviorOptions) in c:\build\src\Commands\Utilities\TeamsUtility.cs:line 255 at PnP.PowerShell.Commands.Teams.NewTeamsTeam.ExecuteCmdlet() in c:\build\src\Commands\Teams\NewTeamsTeam.cs:line 150 at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord() in c:\build\src\Commands\Base\PnPConnectedCmdlet.cs:line 53 CategoryInfo : WriteError: (:) [New-PnPTeamsTeam], GraphException FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Teams.NewTeamsTeam ErrorDetails : Not Found (404): No Team found with Group id: xxxx-xxxx-xxxx-xxxx-xxxx
What is the version of the Cmdlet module you are running?
2.12.0
Which operating system/environment are you running PnP PowerShell on?
- Windows
- Linux
- MacOS
- Azure Cloud Shell
- Azure Functions
- Other : please specify