PowerShell new-team command creates team and SP online site but does not link

Copper Contributor

We are migrating a large number of legacy SharePoint internal sites to Teams / SP Online using the Microsoft SharePoint Migration Tool. Manually, the tool works with some quirks. However, we have over 200 sites with 2,000 subsites - and we intend to migrate the subsites as separate Teams. I am attempting to automate as much of this as possible using a script that analyses the legacy SP site, and creates a PowerShell script to create the new-team, and an input file to feed the migration specifics into the Migration Tool. The problem is that the PowerShell new-team command creates a new Team as expected, and it also creates the SP Online site with the correct URL. Both have the correct owner, but when selecting "Open in SharePoint" from Teams, the owner is redirected to the request access page. The Owner can manually enter the well known URL of the SP Online site and has the expected permissions. Is this a but in the PS new-team command? The Team is created and appears almost immediately, but even after 2 hours, the Team and SP site are not correctly linked.

3 Replies
I made a change to my new-team command to include the intended /teams/target as the -MailNickName and this was the key to creating the SP online site, however, now after 2 hours, Teams continues to say it's "setting up your file directory". Will it eventually link the Team and SP site? If it's just a tenant throttling and will eventually connect, then my process will work as soon as the SP site is created.
Happy to report that after 3+ hours, the Team and SP site were properly linked. I expected cloud to be slower for some access, but it appears that throttling of new sites and migrations is having a bigger impact than we expected.
This is ridiculous. After performing the migration of a second set of 6 sites, all Teams and SP sites are created, but 3 of 6 continue to show "setting up your file directory" after 20 hours! This has to be an issue with the Teams background processing that is probably beyond my control. I intend to escalate a formal ticket with MS support. We can't schedule turnover meetings with business departments without reliable predictable performance of Team creation. FYI - this issue can sometimes happen with interactive Team creation but seldom for more than 3-4 hours.