Commands › Exchange Online
Remove-UnifiedGroupLinks
Remove members, owners, and subscribers from Microsoft 365 Groups in your cloud-based organization. To add members, owners and subscribers, use the Add-UnifiedGroupLinks cmdlet. To modify other properties of Microsoft 365 Groups, use the Set-UnifiedGroup cmdlet. > [!NOTE] > You can't use this cmdlet to modify Microsoft 365 Group members, owners, or subscribers if you connect using certificate based authentication (also known as CBA or app-only authentication for unattended scripts) or Azure managed identity. You can use Microsoft Graph instead. For more information, see Group resource type.
Quick start script
# Remove-UnifiedGroupLinks — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org
# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-UnifiedGroupLinks
$before | Format-List
# 3. Make the change (dry run first)
Remove-UnifiedGroupLinks -Identity <UnifiedGroupIdParameter> -Links <RecipientIdParameter[]> -LinkType <LinkType> -WhatIf
Remove-UnifiedGroupLinks -Identity <UnifiedGroupIdParameter> -Links <RecipientIdParameter[]> -LinkType <LinkType>
# 4. Verify and diff
$after = Get-UnifiedGroupLinks
Compare-Object ($before | Out-String) ($after | Out-String)
Syntax
Remove-UnifiedGroupLinks [-Identity] <UnifiedGroupIdParameter> -Links <RecipientIdParameter[]> -LinkType <LinkType>
[-Confirm]
[-WhatIf]
[<CommonParameters>]
Parameters (5)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.