#Export CSV Results to:
$Path = 'c:\temp\sitegroups.csv'
#Connect to SPO Tenant:
Connect-SPOService "https://tenant-admin.sharepoint.com/"
#Get all SharePoint sites from our Tenant
$spoSites = Get-SPOSite -Limit All
#verifying the groups of every site
foreach ($spoSite in $spoSites)
{
Write-Host $spoSite.Url -ForegroundColor "Yellow"
#fetching all the groups from the site
$groups = Get-SPOSiteGroup -Site $spoSite.Url
# verifying each group
foreach ($group in $groups)
{
#check for the specific group
if($group.Title.Contains("Likes"))
{
Write-Host $group.Title -ForegroundColor "Cyan"
$spoSite.Url | Out-File -FilePath $Path -Append
break;
}
}
}