So, here goes:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
#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; } } } |
