Managing Microsoft Entra ID group life cycle policies is crucial for enforcing governance and automating group management. IT administrators often need to remove specific groups from a life cycle policy to adjust retention settings or exclude them from automated expiration rules. While the Remove-MgGroupFromLifecyclePolicy PowerShell command in Microsoft Graph allows admins to detach groups from a life cycle policy, it requires scripting expertise and manual execution.
ManageEngine ADManager Plus is a comprehensive identity governance and administration solution that simplifies Microsoft Entra ID management and reporting. With powerful management actions and detailed reports, it streamlines administrative tasks and reduces IT workload.
Before running the Remove-MgGroupFromLifecyclePolicy cmdlet, ensure the following requirements are met:
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Group.ReadWrite.All"
Use the Remove-MgGroupFromLifecyclePolicy cmdlet in Microsoft Graph PowerShell to remove Microsoft Entra ID groups from life cycle policies. The syntax is as follows:
Remove-MgGroupFromLifecyclePolicy
-GroupLifecyclePolicyId <String>
[-ResponseHeadersVariable <String>]
[-AdditionalProperties <Hashtable>]
[-GroupId <String>]
[-Headers <IDictionary>]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Example: Remove a group from a life cycle policy
Use this Graph PowerShell command to remove a Microsoft Entra ID group from a life cycle policy.
Import-Module Microsoft.Graph.Groups
$params = @{
groupId = "3b27f8a3-9c4b-4d3b-bc72-2a4f6e2d9a0d"
}
Remove-MgGroupFromLifecyclePolicy -GroupLifecyclePolicyId $groupLifecyclePolicyId -BodyParameter $params
The table below lists key parameters that can be used with the Remove-MgGroupFromLifecyclePolicy cmdlet to remove Microsoft Entra ID groups from life cycle policies.
| Parameters | Description |
|---|---|
| -Confirm | This is to confirm before running the cmdlet. |
| -GroupLifecyclePolicyId | This is the unique identifier of the group life cycle policy. |
| -GroupID | This is the unique identifier of a group. |
| -WhatIf | This shows what would happen if the cmdlet was run. |