Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Remove-EntraGroup

Removes a group.

Syntax

Default (Default)

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'
$group = Get-EntraGroup -Filter "DisplayName eq 'HelpDesk Team Leaders'"
Remove-EntraGroup -GroupId $group.Id

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

  • GroupId parameter specifies the group ID .

Example 2: Remove a group using pipelining

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.

Parameters

-GroupId

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

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ObjectId

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Related Links


Feedback

Was this page helpful?