Remove-EntraGroup

Removes a group.

Syntax

Remove-EntraGroup
      -GroupId <String>
      [<CommonParameters>]

Description

The Remove-EntraGroup cmdlet removes a group from Microsoft Entra ID. Specify the GroupId parameter removes a group.

Unified Group can be restored withing 30 days after deletion using the Restore-EntraBetaDeletedDirectoryObject cmdlet. Security groups can't be restored after deletion.

Notes on permissions:

The following conditions apply for apps to delete role-assignable groups:

  • For delegated scenarios, the app must be assigned the RoleManagement.ReadWrite.Directory delegated permission, and the calling user must be the creator of the group or be assigned at least the Privileged Role Administrator Microsoft Entra role.
  • For app-only scenarios, the calling app must be the owner of the group or be assigned the RoleManagement.ReadWrite.Directory application permission or be assigned at least the Privileged Role Administrator Microsoft Entra role.

Examples

Example 1: Remove a group

Connect-Entra -Scopes 'Group.ReadWrite.All'
Get-EntraGroup -Filter "DisplayName eq 'HelpDesk Team Leaders'" | Remove-EntraGroup

This example demonstrates how to remove a group in Microsoft Entra ID.

  • GroupId parameter specifies the group ID .

Parameters

-GroupId

Specifies the object ID of a group in Microsoft Entra ID.

Type:System.String
Aliases:ObjectId
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False