posts
Wonder how you can find the channel and team associated with a SharePoint Url. If you are lucky you may have used brilliant naming conventions. However if not, this script will help identify which Teams and Channels the SharePoint Site Url belongs to.
cls $domain = "contoso"; # Connection String Variables, including client specific ID and Tenant $clientId = "c9b5eaab-40cf-4e97-98ba-822241c2088c" #$dateTime = (Get-Date).toString("dd-MM-yyyy-hh-ss") $invocation = (Get-Variable MyInvocation).Value $directorypath = Split-Path $invocation.
posts
cls # Connection String Variables, including client specific ID and Tenant #$dateTime = (Get-Date).toString("dd-MM-yyyy-hh-ss") $invocation = (Get-Variable MyInvocation).Value $directorypath = Split-Path $invocation.MyCommand.Path # Set parameters $csvPath = $directorypath + "\Sites.csv" # CSV should have a column 'SiteUrl' $destList = "SMPSitesInventory"; # Define users to exclude # Output CSV for results #$outputCsv = $directorypath + ".\transformSpSites_IntoTeams_Channels_files" + $dateTime + ".csv" #$results = @() $domain = "bankofenglandcouk"; $adminSiteURL = "https://$domain.SharePoint.com" Connect-PnPOnline -Url $adminSiteURL -ClientId $clientId # Read sites from CSV $sites = Import-Csv -Path $csvPath $destconn = Connect-PnPOnline -Url $destiUrl -ClientId $clientId -ReturnConnection foreach ($s in $sites) { $siteUrl = $s.