Deleting Microsoft Entra ID groups is a critical task for IT administrators to maintain a clean and secure directory, ensuring that obsolete or unnecessary groups do not pose any security risks. Whether decommissioning unused groups or enforcing governance policies, admins need an efficient way to manage the removal of groups. While the Remove-MgGroup PowerShell command in Microsoft Graph allows for group removal, it requires long scripts and is time-consuming.
For a more efficient and user-friendly approach, ManageEngine ADManager Plus offers the ideal solution. With its user-friendly interface, administrators can easily identify, review, and delete Microsoft Entra ID groups in bulk—ensuring seamless directory management without the need for complex PowerShell scripts.
Select the Microsoft 365 tenant.
Import the list of groups with a CSV file.
Select the desired Microsoft Entra ID groups to be deleted.
Before running the Remove-MgGroup cmdlet, ensure the following requirements are met:
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Group.ReadWrite.All"
Use the Remove-MgGroup cmdlet in Microsoft Graph PowerShell to delete Microsoft Entra ID groups. The syntax is as follows:
Remove-MgGroup
-GroupId <String>
[-IfMatch <String>]
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-PassThru]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Example: Remove a Microsoft Entra ID group
Use this Graph PowerShell command to delete a Microsoft Entra ID group.
Remove-MgGroup -GroupId 'f6b9791b-dfc1-40d6-9ab6-7b29126c534a'
The table below lists key parameters that can be used with the Remove-MgGroup cmdlet to delete Microsoft Entra ID groups.
| Parameters | Description |
|---|---|
| -GroupId | This is the unique identifier of the group. |
| -Headers | This is for optional headers that will be added to the request. |
| -Confirm | This prompts the admin to confirm before running the cmdlet. |
| -WhatIf | This shows what would happen if the cmdlet was run. The cmdlet is not actually run. |