Feb 26 2020 05:00 AM
I'm working on some automation with the Microsoft Teams PowerShell module. But after creating a new Microsoft Team and directly create some channels the folders are not created. As attachment the PowerShell script and .csv (import file) i use to automate this proces.
As attachment i upload the scripts i use in this scenario. I also raised a support ticket within the admin center. But they don't deliver support on PowerShell scripts and re-routed me to the Premium support.
Feb 26 2020 08:31 AM
Since Teams provisions multiple resources across different workloads, the process can take a while (even up to 24h) to complete. If you want to provision folders/files immediately, use the corresponding SPO tools (CSOM or the Graph API endpoints).
Feb 27 2020 03:42 AM
@Vasil Michev you're right that provision of teams sometimes can take up to 24 hours, but after running the command "New-TeamChannel" a folder should be created directly in SharePoint Online. In this case i created a script (see attachment) with and iteration to create multiple channels with different names. Folders are not created in SharePoint Online, if i run this command directly in PowerShell the specific folder is created directly.
It's possible to reproduce this issue with the following two commands (first wait until the first command is finished) and then run the second one
$team = New-Team -DisplayName "TestTechCommunity"
New-TeamChannel -GroupId $team.groupId -Displayname "test"
In this scenario the channel is visible in teams but if you look in SharePoint, no folder is created.
May 24 2022 10:33 AM
Nov 09 2022 10:13 PM
Jun 20 2023 02:06 PM
@TrynaDoStuff Perfect! This should have better visibility as many people are having the same issue when automating deployments!
Note, if you're using the client sdk from c# it can be done in similar fashion (non-async):
GraphClient.Teams[Team.Id].Channels[Channel.Id].FilesFolder.Request().GetAsync().GetAwaiter().GetResult();
Jun 27 2023 07:45 AM
@TrynaDoStuff thanks for sharing this information.
For others looking for implementing this solution, you could achieve this in Power Automate / Logic Apps as follows:
Indeed I configure authentication based on an app registration as you suggested.