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.Directorydelegated 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.Directoryapplication 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.
GroupIdparameter 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
(All)
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
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.