Forum Discussion
Mitch Crump
Feb 06, 2020Copper Contributor
Creating a folder in SharePoint when you don't know the full site URL
Working in a demo tenant and every team I spin up has a URL of something like https://tenantname.sharepoint.com/sites/msteams_851011. How can I add folders to these newly created teams when the URL i...
Mitch Crump
Feb 06, 2020Copper Contributor
Mitch Crump I have a foreach loop to return the full URL. I commented out the write-output piece because I just want the URL in the variable.
$Teams = "Team1","Team2"
$Teams = (Get-Team |Select GroupId, DisplayName)
ForEach ($Team in $Teams)
{
$SPOURl = (Get-UnifiedGroup -Identity $Team.GroupId | Select -ExpandProperty SharePointSiteURL)
#Write-Output "URL for the" $Team.DisplayName "team is" $SPOURL
}