How to delete Yammer groups by group ID using REST API PowerShell
In this example, we are deleting the "Marketing Team" Yammer group with ID 37024227329
$token = "YOUR-TOKEN"
$yammerbaseurl = "https://www.yammer.com/api/v1/groups.json"
$headers = @{ "Authorization" = "Bearer "+$token }
$webRequest = Invoke-WebRequest -Uri $yammerbaseurl -Method Get -Headers $Headers
$groups = $webRequest.Content | ConvertFrom-Json
$groups | Select-Object id, name
# export to csv
$groups | Select-Object id, name | Export-Csv "C:\temp\yammer-groups.csv"
Copy the group id
$token = "YOUR-TOKEN"
$yammerbaseurl = "https://www.yammer.com/api/v1"
$headers = @{ "Authorization" = "Bearer "+$token }
$groupid = "GROUP-ID-NUMBER"
$webRequest = Invoke-WebRequest -Uri "$yammerbaseurl/groups/$($groupId).json" -Method Delete -Headers $Headers
Check if the Yammer Microsoft 365 unified group and SharePoint site have been removed following this guide
Yammer - Name is already in use by another community
https://techlabs.blog/categories/office-365/yammer-name-is-already-in-use-by-another-community
Comments