Apr 10 2021 02:10 PM - edited Apr 10 2021 02:12 PM
Hello
I am using following script and am getting following error. Am I missing something?
New-Team : GroupId couldn't be found, GroupId is invalid.
Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking
$AdminCenterURL = "https://avian-admin.sharepoint.com"
$SiteURL = "https://avian.sharepoint.com/sites/legal"
#Get Credentials to connect
$Cred = Get-Credential
#Connect to SharePoint Online
Connect-SPOService -Url $AdminCenterURL -Credential $Cred
#Connect to Microsoft Teams
Connect-MicrosoftTeams -Credential $Cred
#Get the Site collection
$Site = Get-SPOSite -Identity $SiteURL
#Create Teams from the SharePoint Site
New-Team -GroupId $Site.GroupId.Guid
Apr 10 2021 08:47 PM
Hi @Avian 1
Your script works for me. I'm using 2.0.0 version of the MicrosoftTeams PowerShell module.
Is it possible that the site you are promoting as a team is not Microsoft 365 Group enabled?
Is $Site.GroupId returning a value?
Apr 11 2021 12:48 AM - edited Apr 11 2021 05:31 AM
How to check that Microsoft 365 group is enabled or not for site?
Yes, $Site.GroupID is returning value
However if I test same script in another tenant, it is working fine, creating team site, but when I see the list of SharePoint sites in SharePoint Admin, Primary Admin is showing as user name instead of Group owners and Template it is showing as Team site (no Microsoft group) instead of Team Site. However when I create site manually, everything is coming properly. This is strange.
Regards
Avian
Apr 12 2021 02:05 AM