pnp / powershell

PnP PowerShell
https://pnp.github.io/powershell
MIT License
669 stars 344 forks source link

[BUG]: Bad Request (400): Team owner not found for group 6f0b96a6-ff6b-481d-aee9-ecec77140ba6 #4304

Closed priyatr closed 2 weeks ago

priyatr commented 2 weeks ago

Hi, I am using the latest pnp.powershell version and connecting the Connect-PnPOnline using certificate password/thumbprint option. Previously, I was creating new sites using the following command with user-based authentication and it was working fine. $newTeam = New-PnPTeamsTeam -DisplayName $teamName -MailNickName $teamAlias -Description $teamName -AllowGuestCreateUpdateChannels $false -AllowGuestDeleteChannels $false -Visibility Private -Connection $adminConnect -EA Stop

Now, I've created a new Entra app registration and completed the app-based MFA setup. However, when I attempt to create a new site using the same above command, it is now failing with following error-

image

So i explicitly add owner and members information in the command-

$newTeam = New-PnPTeamsTeam -DisplayName $teamName -MailNickName $teamAlias -Description $teamName -AllowGuestCreateUpdateChannels $false -AllowGuestDeleteChannels $false -Visibility Private -Owners "v-akankshat@TESTTESTMCAGDevTEST.onmicrosoft.com" -Members "v-akankshat@TESTTESTMCAGDevTEST.onmicrosoft.com" -Connection $adminConnect -EA Stop

But its still failing with following errors, while i already provided both mentioned permission in the error window -

image

Could you please help me why this issue started coming? Is this because of entra app auth and how to resolve this. This is little urgent as my production app is down.

image