How to fix Yammer error - Name is already in use by another community, user, or guest. Permanently delete (purge) soft-deleted Yammer Office 365 groups and SharePoint sites
Yammer error when trying to create a new group
Name is already in use by another community, user, or guest. Please select another name.Office 365 admin center
Teams & Groups - Active teams & groups
Check for active groups with the same name
# Connect to exchange online
Connect-ExchangeOnline -UserPrincipalName admin@yourdomain.com
# Get Yammer unified groups
Get-UnifiedGroup -ResultSize Unlimited | ? {$_.GroupSKU -like "*Yammer*"} | ft
# Get Yammer unified groups, select display name
Get-UnifiedGroup -ResultSize Unlimited | ? {$_.GroupSKU -like "*Yammer*"} | Select DisplayName
Copy the group Display Name
# Remove one M365 group using Display Name
Remove-UnifiedGroup -Identity "DISPLAY NAME" -Confirm:$false
# Delete ALL Yammer M365 groups
$YammerGroups = Get-UnifiedGroup -ResultSize Unlimited | ? {$_.GroupSKU -like "*Yammer*"}
ForEach ($YammerGroup in $YammerGroups ) {
Remove-UnifiedGroup -Identity $YammerGroup.DisplayName -Confirm:$false
}
Office 365 admin center
Teams & Groups - Deleted groups
In the Office 365 admin center, we can see a deleted group with the same name, but there is no option to permanently remove it
We can easily permanently remove (purge) the soft-deleted group using the Azure Portal
Azure Active Directory - Groups - Deleted groups
Delete permanently
# Connect to Azure AD Connect-AzureAD # Get all soft-deleted groups Get-AzureADMSDeletedGroup # Get soft-deleted group by name Get-AzureADMSDeletedGroup -SearchString "Team Leaders" | fl
Copy the group Id
# Remove soft-deleted Office 365 group by Id
Remove-AzureADMSDeletedDirectoryObject -Id 3a83e56a-bea5-4932-b953-dafc4ccb704c
# Remove all soft-deleted Office 365 groups
$deletedgroups = Get-AzureADMSDeletedGroup
ForEach ($deletedgroup in $deletedgroups){
Remove-AzureADMSDeletedDirectoryObject -Id $deletedgroup.id
}
SharePoint admin center
Sites - Deleted sites
Copy the SharePoint site URL
# Install SharePoint online PowerShell Install-Module -Name Microsoft.Online.SharePoint.PowerShell # Update SharePoint online PowerShell Update-Module -Name Microsoft.Online.SharePoint.PowerShell
# Connect to SharePoint online Connect-SPOService -url "https://planetxpressnet-admin.sharepoint.com" # Get Sharepoint Deleted sites Get-SPODeletedSite # Get deleted Sharepoint site by URL Get-SPODeletedSite -Identity https://planetxpressnet.sharepoint.com/sites/SocialClub | fl
Copy the Site URL
Remove-SPODeletedSite -Identity https://planetxpressnet.sharepoint.com/sites/SocialClub
# Permanently remove all soft-deleted sites Get-SPODeletedSite | Remove-SPODeletedSite -Confirm:$false
References:
by Author
SharePoint Online PowerShell - Get-SPODeletedSite
https://learn.microsoft.com/en-us/powershell/module/sharepoint-online/get-spodeletedsite
SharePoint Online PowerShell - Remove-SPODeletedSite
https://learn.microsoft.com/en-us/powershell/module/sharepoint-online/remove-sposite
Exchange PowerShell - Remove-Unified Group
https://learn.microsoft.com/en-us/powershell/module/exchange/remove-unifiedgroup
Comments